結果
問題 | No.1909 Detect from Substrings |
ユーザー | vwxyz |
提出日時 | 2022-05-29 19:06:36 |
言語 | Python3 (3.12.2 + numpy 1.26.4 + scipy 1.12.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 448 bytes |
コンパイル時間 | 147 ms |
コンパイル使用メモリ | 11,888 KB |
実行使用メモリ | 12,760 KB |
最終ジャッジ日時 | 2023-10-21 00:09:27 |
合計ジャッジ時間 | 4,383 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge11 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 32 ms
10,056 KB |
testcase_01 | AC | 31 ms
10,056 KB |
testcase_02 | AC | 30 ms
10,056 KB |
testcase_03 | AC | 31 ms
10,064 KB |
testcase_04 | AC | 31 ms
10,156 KB |
testcase_05 | AC | 32 ms
10,604 KB |
testcase_06 | AC | 32 ms
11,124 KB |
testcase_07 | AC | 32 ms
11,124 KB |
testcase_08 | AC | 106 ms
12,388 KB |
testcase_09 | AC | 37 ms
12,388 KB |
testcase_10 | AC | 62 ms
11,564 KB |
testcase_11 | AC | 50 ms
11,564 KB |
testcase_12 | AC | 36 ms
11,228 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 | - |
ソースコード
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)] if j==N-1: se.add(S[0]+S[1][-1]) se.add(S[1]+S[0][-1]) else: 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)