QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#14957 | #1806. Character Grid | perspective | AC ✓ | 8ms | 8228kb | Python3 | 802b | 2021-10-28 12:44:25 | 2022-05-17 01:20:09 |
Judging History
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