結果

問題 No.197 手品
ユーザー maspy
提出日時 2020-02-02 18:34:25
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 33 ms / 1,000 ms
コード長 447 bytes
コンパイル時間 325 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 11,136 KB
最終ジャッジ日時 2024-07-20 03:58:58
合計ジャッジ時間 2,639 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 43
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

import random

S = list(readline().rstrip())
N = int(readline())
T = list(readline().rstrip())

if N > 4:
    N = 4

answer = 'SUCCESS'
for _ in range(1000):
    A = S[:]
    for _ in range(N):
        i = random.randint(0,1)
        A[i], A[i+1] = A[i+1], A[i]
    if A==T:
        answer = 'FAILURE'
        break

print(answer)
0