結果

問題 No.2000 Distanced Characters
ユーザー ニックネームニックネーム
提出日時 2022-07-08 22:17:41
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 401 bytes
コンパイル時間 315 ms
コンパイル使用メモリ 87,152 KB
実行使用メモリ 90,848 KB
最終ジャッジ日時 2023-08-27 21:56:37
合計ジャッジ時間 9,630 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,564 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 70 ms
71,512 KB
testcase_04 AC 106 ms
77,076 KB
testcase_05 AC 104 ms
77,368 KB
testcase_06 AC 98 ms
77,340 KB
testcase_07 AC 99 ms
77,240 KB
testcase_08 AC 217 ms
90,848 KB
testcase_09 TLE -
testcase_10 AC 1,843 ms
83,044 KB
testcase_11 AC 598 ms
88,380 KB
testcase_12 AC 959 ms
80,208 KB
testcase_13 AC 877 ms
79,872 KB
testcase_14 AC 935 ms
79,116 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from bisect import bisect_left
place = [[] for _ in range(26)]
for i, v in enumerate(input()): place[ord(v)-97].append(i)
d = [list(map(int, input().split())) for _ in range(26)]
ans = [["Y"]*26 for _ in range(26)]
for i in range(26):
    for v in place[i]:
        for j in range(26):
            if bisect_left(place[j], v+d[i][j])-bisect_left(place[j], v+1): ans[i][j] = "N"
for s in ans: print(*s)
0