結果
| 問題 | No.197 手品 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-04-29 06:09:15 |
| 言語 | PyPy2 (7.3.20) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 692 bytes |
| 記録 | |
| コンパイル時間 | 130 ms |
| コンパイル使用メモリ | 77,748 KB |
| 最終ジャッジ日時 | 2025-12-03 14:53:08 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 4 |
| other | AC * 4 WA * 2 TLE * 1 -- * 36 |
ソースコード
#!/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'