結果
問題 | No.1909 Detect from Substrings |
ユーザー |
![]() |
提出日時 | 2022-05-29 19:06:36 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 448 bytes |
コンパイル時間 | 198 ms |
コンパイル使用メモリ | 12,800 KB |
実行使用メモリ | 13,736 KB |
最終ジャッジ日時 | 2024-09-21 00:35:17 |
合計ジャッジ時間 | 3,767 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 10 WA * 26 |
ソースコード
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)