結果

問題 No.197 手品
コンテスト
ユーザー steek79
提出日時 2015-10-21 22:52:15
言語 PyPy2
(7.3.20)
結果
AC  
実行時間 80 ms / 1,000 ms
コード長 455 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 168 ms
コンパイル使用メモリ 77,732 KB
最終ジャッジ日時 2025-12-03 17:41:05
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 43
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

bef = list(raw_input())
N = input()
aft = list(raw_input())

if bef.count('x') != aft.count('x'):
    print 'SUCCESS'
    exit()

if N == 0:
    possible = [bef]
elif N == 1:
    possible = [[bef[1], bef[0], bef[2]], [bef[0], bef[2], bef[1] ]]
elif N == 2:
    possible = [[bef[0], bef[1], bef[2]], [bef[1], bef[2], bef[0]], [bef[2], bef[0], bef[1]]]
else:
    print 'FAILURE'
    exit()

if aft in possible:
    print 'FAILURE'
else:
    print 'SUCCESS'
0