結果
問題 |
No.197 手品
|
ユーザー |
|
提出日時 | 2024-10-28 09:31:27 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 692 bytes |
コンパイル時間 | 555 ms |
コンパイル使用メモリ | 82,448 KB |
実行使用メモリ | 54,172 KB |
最終ジャッジ日時 | 2024-10-28 09:31:31 |
合計ジャッジ時間 | 4,031 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 24 WA * 19 |
ソースコード
S0 = input() N = int(input()) S1 = input() C0 = {"o":0,"x":0} C0["o"] = S0.count("o") C0["x"] = S0.count("x") C1 = {"o":0,"x":0} C1["o"] = S1.count("o") C1["x"] = S1.count("x") if C0["o"]!=C1["o"]: print("SUCCESS") elif C0["o"]==3 or C0["x"]==3: print("FAILURE") elif S0==S1: if N%2==0: print("FAILURE") else: print("SUCCESS") else: ind = 0 for i in range(3): if S0[i]==S1[i]: ind = i break if ind==0 or ind==2: if N%2==1: print("FAILURE") else: print("SUCCESS") else: if N>0 and N%2==0: print("FAILURE") else: print("SUCCESS")