結果

問題 No.197 手品
ユーザー yuppe19 😺
提出日時 2015-04-29 06:09:15
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 692 bytes
コンパイル時間 419 ms
コンパイル使用メモリ 6,912 KB
実行使用メモリ 14,236 KB
最終ジャッジ日時 2024-06-27 08:47:22
合計ジャッジ時間 2,981 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample -- * 4
other AC * 4 WA * 2 TLE * 1 -- * 36
権限があれば一括ダウンロードができます

ソースコード

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() >= 4.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