結果

問題 No.197 手品
コンテスト
ユーザー flippergo
提出日時 2024-10-28 09:31:27
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
WA  
実行時間 -
コード長 692 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 175 ms
コンパイル使用メモリ 84,848 KB
実行使用メモリ 54,164 KB
最終ジャッジ日時 2026-05-05 23:35:15
合計ジャッジ時間 3,583 ms
ジャッジサーバーID
(参考情報)
judge1_1 / judge3_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 24 WA * 19
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

S0 = input()
N = int(input())
S1 = input()
C0 = {"o":0,"x":0}
C0["o"] = S0.count("o")
C0["x"] = S0.count("x")
C1 = {"o":0,"x":0}
C1["o"] = S1.count("o")
C1["x"] = S1.count("x")
if C0["o"]!=C1["o"]:
    print("SUCCESS")
elif C0["o"]==3 or C0["x"]==3:
    print("FAILURE")
elif S0==S1:
    if N%2==0:
        print("FAILURE")
    else:
        print("SUCCESS")
else:
    ind = 0
    for i in range(3):
        if S0[i]==S1[i]:
            ind = i
            break
    if ind==0 or ind==2:
        if N%2==1:
            print("FAILURE")
        else:
            print("SUCCESS")
    else:
        if N>0 and N%2==0:
            print("FAILURE")
        else:
            print("SUCCESS")
    
0