結果
問題 |
No.197 手品
|
ユーザー |
![]() |
提出日時 | 2024-01-01 16:58:44 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 39 ms / 1,000 ms |
コード長 | 653 bytes |
コンパイル時間 | 193 ms |
コンパイル使用メモリ | 82,460 KB |
実行使用メモリ | 53,948 KB |
最終ジャッジ日時 | 2024-09-27 17:25:09 |
合計ジャッジ時間 | 3,192 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 43 |
ソースコード
S1 = input() N = int(input()) S2 = input() def prt(x): if x == 0: print("FAILURE") else: print("SUCCESS") exit() if S1.count("o") != S2.count("o"): prt(1) if S1.count("o") == 0 and S2.count("o") == 0: prt(0) if S1.count("x") == 0 and S2.count("x") == 0: prt(0) if N == 0: if S1 == S2: prt(0) else: prt(1) X1 = int(S1.replace("x","0").replace("o","1"),2) X2 = int(S2.replace("x","0").replace("o","1"),2) if X1 in [3,5,6]: X1 = 7 - X1 X2 = 7 - X2 if N > 1: prt(0) if X1 == 2 and X2 == 2: prt(1) if X1 == 1 and X2 == 4: prt(1) if X1 == 4 and X2 == 1: prt(1) prt(0)