結果

問題 No.197 手品
ユーザー yuppe19 😺
提出日時 2015-04-29 06:11:02
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 691 bytes
コンパイル時間 90 ms
コンパイル使用メモリ 6,912 KB
実行使用メモリ 7,424 KB
最終ジャッジ日時 2024-06-27 08:50:56
合計ジャッジ時間 7,578 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 40 WA * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/python
from random import randint
from datetime import datetime
start = datetime.now()

def nya(s0, s1, n):
    while 1:
        a, b, c = s0
        x, y, z = s1
        for _ in xrange(n):
            if randint(0, 1):
                b, a = a, b
            else:
                c, b = b, c
        if (a, b, c) == (x, y, z):
            return 0
        now = datetime.now()
        if (now - start).total_seconds() >= .7:
            break
    return 1

def fushigi(s0, s1, n):
    if n <= 1:
        return nya(s0, s1, n)
    else:
        return 0

s0 = raw_input()
n = int(raw_input())
s1 = raw_input()
if fushigi(s0, s1, n):
    print 'SUCCESS'
else:
    print 'FAILURE'
0