結果

問題 No.2000 Distanced Characters
ユーザー achapiachapi
提出日時 2022-07-08 21:40:47
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 891 ms / 2,000 ms
コード長 558 bytes
コンパイル時間 304 ms
コンパイル使用メモリ 87,104 KB
実行使用メモリ 90,384 KB
最終ジャッジ日時 2023-08-27 21:05:56
合計ジャッジ時間 4,940 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,276 KB
testcase_01 AC 86 ms
76,096 KB
testcase_02 AC 73 ms
71,272 KB
testcase_03 AC 71 ms
71,544 KB
testcase_04 AC 100 ms
76,928 KB
testcase_05 AC 106 ms
77,496 KB
testcase_06 AC 92 ms
76,996 KB
testcase_07 AC 91 ms
76,372 KB
testcase_08 AC 89 ms
90,016 KB
testcase_09 AC 891 ms
80,964 KB
testcase_10 AC 683 ms
83,708 KB
testcase_11 AC 255 ms
90,384 KB
testcase_12 AC 479 ms
80,008 KB
testcase_13 AC 450 ms
80,016 KB
testcase_14 AC 285 ms
79,036 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

s=input()
from bisect import*
d=[[]for i in range(26)]
al="abcdefghijklmnopqrstuvwxyz"
for i in range(len(s)):d[al.index(s[i])].append(i+1)
for i in range(26):
    l=list(map(int,input().split()))
    ans=[]
    for j in range(26):
        if len(d[i])==0 or len(d[j])==0:ans.append("Y")
        else:
            for a in d[i]:
                b=bisect_right(d[j],a)
                if b!=len(d[j]):
                    if a+l[j]>d[j][b]:
                        ans.append("N")
                        break
            else:ans.append("Y")
    print(*ans)
0