結果
| 問題 | No.197 手品 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-06-06 13:11:44 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 877 bytes |
| 記録 | |
| コンパイル時間 | 362 ms |
| コンパイル使用メモリ | 20,696 KB |
| 実行使用メモリ | 15,488 KB |
| 最終ジャッジ日時 | 2026-03-15 11:54:41 |
| 合計ジャッジ時間 | 6,077 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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()