結果
問題 |
No.197 手品
|
ユーザー |
|
提出日時 | 2015-06-03 12:49:18 |
言語 | Python2 (2.7.18) |
結果 |
WA
|
実行時間 | - |
コード長 | 850 bytes |
コンパイル時間 | 333 ms |
コンパイル使用メモリ | 7,040 KB |
実行使用メモリ | 6,528 KB |
最終ジャッジ日時 | 2024-06-27 09:46:54 |
合計ジャッジ時間 | 1,959 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 41 WA * 2 |
ソースコード
# -*- coding:utf-8 -*- if __name__ == "__main__": s_before = raw_input() n = input() s_after = raw_input() a,b = 0,0 for i,j in zip(s_before,s_after): if i == "o": b += 1 if j == "o": a += 1 if a != b: print "SUCCESS" elif (a == 3 and b == 3) or (a == 0 and b == 0): print "FAILURE" else: if n >= 2: print "FAILURE" elif n == 1: if a == 1: d = abs(s_before.index("o") - s_after.index("o")) if d == 1: print "FAILURE" elif d == 0 and s_before.index("o") != 1: print "FAILURE" else: print "SUCCESS" else: d = abs(s_before.index("x") - s_after.index("x")) if d == 1: print "FAILURE" elif d == 0 and s_before.index("x") != 1: print "FAILURE" else: print "SUCCESS" elif n == 0: if s_after == s_before: print "SUCCESS" else: print "FAILURE"