結果

問題 No.2000 Distanced Characters
ユーザー 👑 KazunKazun
提出日時 2022-10-08 05:01:57
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 181 ms / 2,000 ms
コード長 577 bytes
コンパイル時間 304 ms
コンパイル使用メモリ 87,320 KB
実行使用メモリ 78,900 KB
最終ジャッジ日時 2023-09-04 00:50:31
合計ジャッジ時間 3,278 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
71,336 KB
testcase_01 AC 83 ms
76,284 KB
testcase_02 AC 77 ms
71,132 KB
testcase_03 AC 79 ms
71,320 KB
testcase_04 AC 84 ms
76,416 KB
testcase_05 AC 87 ms
76,560 KB
testcase_06 AC 85 ms
76,488 KB
testcase_07 AC 84 ms
76,060 KB
testcase_08 AC 139 ms
78,824 KB
testcase_09 AC 181 ms
78,848 KB
testcase_10 AC 168 ms
78,528 KB
testcase_11 AC 148 ms
78,900 KB
testcase_12 AC 135 ms
77,412 KB
testcase_13 AC 135 ms
77,620 KB
testcase_14 AC 151 ms
77,620 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#==================================================
def solve():
    S=[ord(s)-ord("a") for s in input()]

    sigma=26
    D=[None for _ in range(sigma)]
    for alpha in range(sigma):
        D[alpha]=list(map(int,input().split()))

    Ans=[["Y"]*sigma for _ in range(sigma)]
    T=[-1]*sigma
    for j,beta in enumerate(S):
        for alpha in range(sigma):
            if T[alpha]!=-1 and T[alpha]+D[alpha][beta]>j:
                Ans[alpha][beta]="N"
        T[beta]=j
    return Ans

#==================================================
for A in solve():
    print(*A)
0