結果

問題 No.2000 Distanced Characters
ユーザー scrappyscrappy
提出日時 2022-07-09 17:15:40
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 496 bytes
コンパイル時間 304 ms
コンパイル使用メモリ 10,928 KB
実行使用メモリ 36,964 KB
最終ジャッジ日時 2023-08-30 00:58:42
合計ジャッジ時間 7,357 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
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')

print(f"{time.time() - time0} sec")
0