結果

問題 No.197 手品
ユーザー ntudantuda
提出日時 2024-01-01 16:47:41
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 625 bytes
コンパイル時間 238 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 53,460 KB
最終ジャッジ日時 2024-01-01 16:47:45
合計ジャッジ時間 3,841 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
53,460 KB
testcase_01 AC 35 ms
53,460 KB
testcase_02 AC 35 ms
53,460 KB
testcase_03 AC 35 ms
53,460 KB
testcase_04 AC 37 ms
53,460 KB
testcase_05 AC 35 ms
53,460 KB
testcase_06 AC 35 ms
53,460 KB
testcase_07 AC 34 ms
53,460 KB
testcase_08 AC 37 ms
53,460 KB
testcase_09 AC 35 ms
53,460 KB
testcase_10 AC 36 ms
53,460 KB
testcase_11 AC 35 ms
53,460 KB
testcase_12 WA -
testcase_13 AC 35 ms
53,460 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 36 ms
53,460 KB
testcase_24 AC 36 ms
53,460 KB
testcase_25 AC 36 ms
53,460 KB
testcase_26 AC 36 ms
53,460 KB
testcase_27 WA -
testcase_28 AC 35 ms
53,460 KB
testcase_29 WA -
testcase_30 AC 36 ms
53,460 KB
testcase_31 AC 36 ms
53,460 KB
testcase_32 AC 36 ms
53,460 KB
testcase_33 WA -
testcase_34 AC 35 ms
53,460 KB
testcase_35 AC 36 ms
53,460 KB
testcase_36 WA -
testcase_37 WA -
testcase_38 AC 36 ms
53,460 KB
testcase_39 WA -
testcase_40 AC 36 ms
53,460 KB
testcase_41 WA -
testcase_42 AC 37 ms
53,460 KB
testcase_43 AC 35 ms
53,460 KB
testcase_44 WA -
testcase_45 AC 36 ms
53,460 KB
testcase_46 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

S1 = input()
N = int(input())
S2 = input()

def prt(x):
    if x == 0:
        print("FAILURE")
    else:
        print("SUCCESS")
    exit()

if S1.count("o") != S2.count("o"):
    prt(1)
if S1.count("o") == 0 and S2.count("o") == 0:
    prt(0)
if S1.count("x") == 0 and S2.count("x") == 0:
    prt(0)
if N == 0:
    if S1 == S2:
        prt(0)
    else:
        prt(1)

X1 = int(S1.replace("x","0").replace("o","1"),2)
X2 = int(S2.replace("x","0").replace("o","1"),2)
if X1 in [3,5,6]:
    X1 = 7 - X1
    X2 = 7 - X2
if X1 == 4:
    X1 = 1
if X2 == 4:
    X2 = 1
if (X1 == X2) ^ (N % 2 == 0):
    prt(1)
else:
    prt(0)

0