結果

問題 No.2000 Distanced Characters
ユーザー 👑 H20H20
提出日時 2022-07-08 22:51:15
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,307 ms / 2,000 ms
コード長 454 bytes
コンパイル時間 1,499 ms
コンパイル使用メモリ 86,832 KB
実行使用メモリ 100,256 KB
最終ジャッジ日時 2023-08-27 22:38:45
合計ジャッジ時間 6,640 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,552 KB
testcase_01 AC 98 ms
76,496 KB
testcase_02 AC 76 ms
71,192 KB
testcase_03 AC 76 ms
71,372 KB
testcase_04 AC 111 ms
77,400 KB
testcase_05 AC 118 ms
77,536 KB
testcase_06 AC 103 ms
77,396 KB
testcase_07 AC 100 ms
77,368 KB
testcase_08 AC 258 ms
100,256 KB
testcase_09 AC 1,307 ms
87,972 KB
testcase_10 AC 1,092 ms
91,628 KB
testcase_11 AC 362 ms
96,612 KB
testcase_12 AC 561 ms
84,356 KB
testcase_13 AC 515 ms
84,000 KB
testcase_14 AC 577 ms
83,644 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import bisect
S = list(input())
D = []
for _ in range(26):
    D.append(list(map(int, input().split())))
AL = [[] for _ in range(26)]
for i,s in enumerate(S):
    AL[ord(s)-97].append(i)
ANS = [['Y']*26 for _ in range(26)]
for a in range(26):
    for al in AL[a]:
        for b in range(26):
            v = bisect.bisect_left(AL[b],al+1)
            if v<len(AL[b]) and al+D[a][b]>AL[b][v]:
                ANS[a][b]='N'
for ans in ANS:
    print(*ans)
0