結果

問題 No.1909 Detect from Substrings
ユーザー vwxyzvwxyz
提出日時 2022-05-29 19:09:37
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 371 bytes
コンパイル時間 95 ms
コンパイル使用メモリ 11,924 KB
実行使用メモリ 12,732 KB
最終ジャッジ日時 2023-10-21 00:09:31
合計ジャッジ時間 3,830 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
10,032 KB
testcase_01 AC 31 ms
10,032 KB
testcase_02 AC 32 ms
10,032 KB
testcase_03 AC 30 ms
10,040 KB
testcase_04 AC 30 ms
10,136 KB
testcase_05 AC 31 ms
10,596 KB
testcase_06 AC 32 ms
10,992 KB
testcase_07 AC 31 ms
10,992 KB
testcase_08 AC 106 ms
12,360 KB
testcase_09 AC 36 ms
12,360 KB
testcase_10 AC 64 ms
11,536 KB
testcase_11 AC 50 ms
11,536 KB
testcase_12 AC 36 ms
11,200 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
readline=sys.stdin.readline
N,M=map(int,readline().split())
S=[readline().rstrip() for i in range(N)]
for j in range(M):
    if S[0][j]!=S[1][j]:
        break
se=set()
alp=[chr(i) for i in range(97,97+26)]
se.add(S[0][:j]+S[1][j]+S[0][j:])
se.add(S[1][:j]+S[0][j]+S[1][j:])
ans=0
for s in se:
    if all(S[i] in s for i in range(N)):
        ans+=1
print(ans)
0