結果

問題 No.2000 Distanced Characters
ユーザー scrappyscrappy
提出日時 2022-07-09 17:16:26
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 458 bytes
コンパイル時間 260 ms
コンパイル使用メモリ 10,964 KB
実行使用メモリ 37,100 KB
最終ジャッジ日時 2023-08-30 00:59:51
合計ジャッジ時間 7,743 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 134 ms
29,880 KB
testcase_03 AC 139 ms
29,564 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 TLE -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import string
import numpy as np

S = input()
D = np.array([[int(a) for a in input().split()] for i in range(26)])
ss = np.array(list(S))

for u in range(26):
    a = string.ascii_lowercase[u]
    ii = np.where(ss==a)[0]
    for v in range(26):
        b = string.ascii_lowercase[v]
        flag = 'Y'
        for i in ii:
            if b in S[i:i+D[u,v]]:
                flag = 'N'
                break

        print(flag, end=' ' if v+1 < 26 else '\n')
0