結果
問題 | No.197 手品 |
ユーザー |
![]() |
提出日時 | 2017-05-19 15:00:56 |
言語 | Python2 (2.7.18) |
結果 |
WA
|
実行時間 | - |
コード長 | 705 bytes |
コンパイル時間 | 609 ms |
コンパイル使用メモリ | 6,912 KB |
実行使用メモリ | 6,400 KB |
最終ジャッジ日時 | 2024-06-27 13:46:08 |
合計ジャッジ時間 | 1,844 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 28 WA * 15 |
ソースコード
def possible(sb, n, sa): bo = 0 for c in sb: if c == 'o': bo += 1 ao = 0 for c in sa: if c == 'o': ao += 1 if bo != ao: return False elif bo == 0 or bo == 3: return True pb = 0 for i,c in enumerate(sb): if (bo == 1 and c == 'O') or (bo == 2 and c == 'x'): pb = i break pa = 0 for i,c in enumerate(sa): if (bo == 1 and c == 'o') or (bo == 2 and c == 'x'): pa = i break d = abs(pb - pa) return (d % 2) == (n % 2) sb = raw_input() n = int(raw_input()) sa = raw_input() if possible(sb, n, sa): print 'FAILURE' else: print 'SUCCESS'