結果

問題 No.2000 Distanced Characters
ユーザー first_vilfirst_vil
提出日時 2022-07-08 23:50:11
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 169 ms / 2,000 ms
コード長 714 bytes
コンパイル時間 269 ms
コンパイル使用メモリ 86,892 KB
実行使用メモリ 79,112 KB
最終ジャッジ日時 2023-08-28 08:50:24
合計ジャッジ時間 3,206 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 80 ms
71,320 KB
testcase_01 AC 87 ms
76,660 KB
testcase_02 AC 76 ms
71,072 KB
testcase_03 AC 76 ms
71,056 KB
testcase_04 AC 85 ms
76,488 KB
testcase_05 AC 86 ms
76,480 KB
testcase_06 AC 85 ms
76,748 KB
testcase_07 AC 86 ms
76,744 KB
testcase_08 AC 166 ms
78,688 KB
testcase_09 AC 165 ms
78,684 KB
testcase_10 AC 164 ms
79,112 KB
testcase_11 AC 169 ms
78,908 KB
testcase_12 AC 134 ms
77,088 KB
testcase_13 AC 134 ms
76,944 KB
testcase_14 AC 147 ms
77,140 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

int1 = lambda x: int(x) - 1

# input = lambda: sys.stdin.buffer.readline()
input = lambda: sys.stdin.readline().rstrip()
ii = lambda: int(input())
i1 = lambda: int1(input())
mi = lambda: map(int, input().split())
mi1 = lambda: map(int1, input().split())
li = lambda: list(mi())
li1 = lambda: list(mi1())
lli = lambda n: [li() for _ in range(n)]

INF = float("inf")
mod = int(1e9 + 7)
# mod = 998244353

a = [ord(c) - ord("a") for c in input()]
d = [li() for i in range(26)]
pre = [-INF for i in range(26)]
x = [["Y"] * 26 for i in range(26)]
for i, j in enumerate(a):
    for k in range(26):
        if pre[k] + d[k][j] > i:
            x[k][j] = "N"
    pre[j] = i
for i in range(26):
    print(*x[i])
0