09.24 WPS 笔试

#1 找就完了

print(input().find('NiuNiu'))

#2 排序就完了

n = int(input())
d = set()
for _ in range(n):
    s = str(sorted(input()))
    d.add(s)
print(len(d))

#3 模拟就完了

n = int(input())
mid = 3 * (2 ** (n - 1)) - 1
a = [[' '] * (2 * mid + 1) for _ in range(2 ** (n - 1) * 3 + n)]
a[0][mid] = '*'
a[1][mid - 1] = '*'
a[1][mid + 1] = '*'
a[2][mid - 2] = '*'
a[2][mid] = '*'
a[2][mid + 2] = '*'
for i in range(n):
    a[-(i + 1)][mid] = '*'
def cp(src_x, src_y, dst_x, dst_y, w, h):
    for i in range(h):
        for j in range(w):
            a[dst_y + i][dst_x + j] = a[src_y + i][src_x + j]
src_y = 0
src_x = mid - 2
for i in range(n - 1):
    w = 5 * (2 ** i) + (2 ** i - 1)
    h = 3 * (2 ** i)
    cp(src_x, 0, mid + 1, h, w, h)
    cp(src_x, 0, mid - w, h, w, h)
    src_x = dst_x
for s in a:
    print(''.join(s))

#金山wps##笔经#
全部评论

相关推荐

06-26 10:08
门头沟学院 C++
北京Golang实习,一个月4700,吃住都不报,公司位置在海淀。请问友友怎么看呢?如果要租房的话有什么建议吗
码农索隆:租房肯定是合租了,剩下的钱,差不多够正常吃饭了,看看能不能学到东西吧
点赞 评论 收藏
分享
仁者伍敌:牛子这些人还会点一个自动回复,boss都不带回复的
点赞 评论 收藏
分享
点赞 评论 收藏
分享
评论
点赞
3
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务