結果

問題 No.197 手品
コンテスト
ユーザー aka_satana_ha
提出日時 2017-11-27 14:19:07
言語 Python3
(3.14.3 + numpy 2.4.4 + scipy 1.17.1)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
RE  
実行時間 -
コード長 835 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 439 ms
コンパイル使用メモリ 20,824 KB
実行使用メモリ 20,700 KB
最終ジャッジ日時 2026-03-15 12:10:56
合計ジャッジ時間 7,750 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3 RE * 1
other AC * 31 RE * 12
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

S_before=input()
N=int(input())
S_after=input()

coin_before=S_before.count('o')
coin_after=S_after.count('o')

#コインの数が違う
if coin_after!=coin_before:
    print("SUCCESS")
    exit()

#コインが0または3つ
if coin_before==0 or coin_before==3:
    print("FAILURE")
    exit()

#コインが1つまたは2つ
if N<1:
    if S_before!=S_after:
        print("SUCCESS")
    else:
        print("FAILURE")
    exit()
elif N==1:
    if (cont_before == 1 and S_before[0]=='o' and S_after[2]=='o') or \
       (cont_before == 1 and S_before[2]=='o' and S_after[0]=='o') or \
       (cont_before == 2 and S_before[0]=='x' and S_after[2]=='x') or \
       (cont_before == 2 and S_before[2]=='x' and S_after[0]=='x'):
       print("SUCCESS")
    else:
       print("FAILURE")
    exit()
else:
    print("FAILURE")
    exit()
0