QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#14957#1806. Character GridperspectiveAC ✓8ms8228kbPython3802b2021-10-28 12:44:252022-05-17 01:20:09

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-05-17 01:20:09]
  • 评测
  • 测评结果:AC
  • 用时:8ms
  • 内存:8228kb
  • [2021-10-28 12:44:25]
  • 提交

answer

n = 13
MOD = 26
grid = [[0] * n for _ in range(n)]
for i in range(n):
    for j in range(n):
        if i == j == 0:
            continue
        if j == 0:
            grid[i][j] = (grid[i - 1][j] + i + 1) % MOD
        else:
            grid[i][j] = (grid[i][j - 1] + i + j) % MOD

"""
se = set()
for i in range(n):
    for j in range(n):
        if i != n - 1:
            tmp = grid[i][j] * 100 + grid[i + 1][j]
            if tmp in se:
                print("=========")
            se.add(tmp)
        if j != n - 1:
            tmp = grid[i][j] * 100 + grid[i][j + 1]
            if tmp in se:
                print("=========")
            se.add(tmp)
"""

def f(x):
    return chr(x + 97)
print(n)            
for row in grid:
    print("".join(map(f, row)))

詳細信息

Test #1:

score: 100
Accepted
time: 8ms
memory: 8228kb

input:



output:

13
abdgkpvcktdoa
cehlqwdluepbo
fimrxemvfqcpd
jnsyfnwgrdqet
otzgoxhserfuk
uahpyitfsgvlc
biqzjugthwmdv
jrakvhuixnewp
sblwivjyofxqk
cmxjwkzpgyrlg
nykxlaqhzsmhd
zlymbriatnieb
mzncsjbuojfca

result:

ok accepted