結果

問題 No.197 手品
ユーザー ronpoo
提出日時 2023-10-30 16:28:05
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 42 ms / 1,000 ms
コード長 512 bytes
コンパイル時間 543 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 52,352 KB
最終ジャッジ日時 2024-09-25 17:18:39
合計ジャッジ時間 3,427 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 43
権限があれば一括ダウンロードができます

ソースコード

diff #

S = input()
N = int(input())
T = input()

sc = S.count('o')
tc = T.count('o')
if sc != tc:
    print('SUCCESS')
    exit()
elif sc == 3 or sc == 0:
    if S == T:
        print('FAILURE')
    else:
        print('SUCCESS')
    exit()

if sc == 1:
    x = 'o'
else:
    x = 'x'

an = []
for a in [S, T]:
    for i in range(3):
        if a[i] == x:
            an.append(i)

if an[0] == 1 and an[1] == 1 and N == 1:
    print('SUCCESS')
elif max(an) - min(an) > N:
    print('SUCCESS')
else:
    print('FAILURE')
0