結果

問題 No.197 手品
ユーザー yuppe19 😺yuppe19 😺
提出日時 2015-04-29 06:09:15
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 692 bytes
コンパイル時間 447 ms
コンパイル使用メモリ 6,552 KB
実行使用メモリ 8,916 KB
最終ジャッジ日時 2023-09-09 16:00:16
合計ジャッジ時間 4,246 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
8,664 KB
testcase_01 AC 14 ms
8,916 KB
testcase_02 AC 15 ms
8,720 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 15 ms
8,784 KB
testcase_06 TLE -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
testcase_43 -- -
testcase_44 -- -
testcase_45 -- -
testcase_46 -- -
権限があれば一括ダウンロードができます

ソースコード

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