結果
| 問題 |
No.197 手品
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-06-06 13:11:44 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 877 bytes |
| コンパイル時間 | 81 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 10,880 KB |
| 最終ジャッジ日時 | 2024-06-27 13:46:53 |
| 合計ジャッジ時間 | 2,720 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 24 WA * 19 |
ソースコード
import sys
def solve():
sb = input()
n = int(input())
sa = input()
f = 'FAILURE'
s = 'SUCCESS'
if sb == 'ooo':
if sa == 'ooo':
ans = f
else:
ans = s
elif sb == 'xxx':
if sa == 'xxx':
ans = f
else:
ans = s
elif sb.count('o') == 1:
if sa.count('o') != 1:
ans = s
else:
ib = sb.index('o')
ia = sa.index('o')
if (ia - ib) % 2 == n % 2:
ans = f
else:
ans = s
else:
if sb.count('x') != 1:
ans = s
else:
ib = sb.index('x')
ia = sa.index('x')
if (ia - ib) % 2 == n % 2:
ans = f
else:
ans = s
print(ans)
if __name__ == '__main__':
solve()