結果

問題 No.197 手品
ユーザー aka_satana_haaka_satana_ha
提出日時 2017-11-27 14:25:37
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 18 ms / 1,000 ms
コード長 983 bytes
コンパイル時間 98 ms
コンパイル使用メモリ 10,864 KB
実行使用メモリ 8,304 KB
最終ジャッジ日時 2023-09-27 09:46:42
合計ジャッジ時間 2,618 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
8,128 KB
testcase_01 AC 18 ms
8,224 KB
testcase_02 AC 16 ms
8,132 KB
testcase_03 AC 15 ms
8,160 KB
testcase_04 AC 16 ms
8,156 KB
testcase_05 AC 16 ms
8,224 KB
testcase_06 AC 16 ms
8,216 KB
testcase_07 AC 15 ms
8,152 KB
testcase_08 AC 16 ms
8,152 KB
testcase_09 AC 16 ms
8,156 KB
testcase_10 AC 16 ms
8,224 KB
testcase_11 AC 16 ms
8,156 KB
testcase_12 AC 16 ms
8,096 KB
testcase_13 AC 16 ms
8,176 KB
testcase_14 AC 16 ms
8,092 KB
testcase_15 AC 16 ms
8,184 KB
testcase_16 AC 16 ms
8,092 KB
testcase_17 AC 16 ms
8,224 KB
testcase_18 AC 16 ms
8,216 KB
testcase_19 AC 16 ms
8,212 KB
testcase_20 AC 17 ms
8,156 KB
testcase_21 AC 16 ms
8,288 KB
testcase_22 AC 16 ms
8,304 KB
testcase_23 AC 15 ms
8,092 KB
testcase_24 AC 16 ms
8,152 KB
testcase_25 AC 16 ms
8,152 KB
testcase_26 AC 16 ms
8,100 KB
testcase_27 AC 16 ms
8,124 KB
testcase_28 AC 16 ms
8,216 KB
testcase_29 AC 16 ms
8,088 KB
testcase_30 AC 16 ms
8,132 KB
testcase_31 AC 16 ms
8,216 KB
testcase_32 AC 15 ms
8,236 KB
testcase_33 AC 16 ms
8,180 KB
testcase_34 AC 16 ms
8,160 KB
testcase_35 AC 16 ms
8,140 KB
testcase_36 AC 16 ms
8,300 KB
testcase_37 AC 16 ms
8,228 KB
testcase_38 AC 16 ms
8,136 KB
testcase_39 AC 16 ms
8,116 KB
testcase_40 AC 16 ms
8,216 KB
testcase_41 AC 16 ms
8,152 KB
testcase_42 AC 16 ms
8,128 KB
testcase_43 AC 16 ms
8,244 KB
testcase_44 AC 15 ms
8,152 KB
testcase_45 AC 16 ms
8,224 KB
testcase_46 AC 16 ms
8,252 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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 (coin_before==1 and S_before[0]=='o' and S_after[2]=='o') or \
       (coin_before==1 and S_before[2]=='o' and S_after[0]=='o') or \
       (coin_before==2 and S_before[0]=='x' and S_after[2]=='x') or \
       (coin_before==2 and S_before[2]=='x' and S_after[0]=='x') or \
       (coin_before==1 and S_before[1]==S_after[1] and S_before[1]=='o') or \
       (coin_before==2 and S_before[1]==S_after[1] and S_before[1]=='x'):
       print("SUCCESS")
    else:
       print("FAILURE")
    exit()
else:
    print("FAILURE")
    exit()
0