結果

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

ソースコード

diff #
raw source code

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

def nya(s0, s1):
    while 1:
        a, b, c = s0
        x, y, z = s1
        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 == 0:
        return s0 != s1
    if n == 1:
        return nya(s0, s1)
    else:
        return 0

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