結果

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

ソースコード

diff #
raw source code

s1 = raw_input()
N = min(2, int(raw_input()))
s2 = raw_input()
S = set([s1])
while N:
    nS = set([])
    for s in S:
        nS.add(s[0] + s[2] + s[1])
        nS.add(s[1] + s[0] + s[2])
    S = nS.copy()
    N -= 1
print "FAILURE" if s2 in S else "SUCCESS"
0