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##笔经#
全部评论

相关推荐

11-11 14:21
西京学院 C++
Java抽象练习生:教育背景放最前面,不要耍小聪明
点赞 评论 收藏
分享
点赞 3 评论
分享
牛客网
牛客企业服务