結果

問題 No.197 手品
ユーザー NagisaNagisa
提出日時 2016-07-23 20:51:41
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 16 ms / 1,000 ms
コード長 920 bytes
コンパイル時間 94 ms
コンパイル使用メモリ 10,860 KB
実行使用メモリ 8,376 KB
最終ジャッジ日時 2023-09-27 09:41:30
合計ジャッジ時間 2,200 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
8,232 KB
testcase_01 AC 14 ms
7,860 KB
testcase_02 AC 15 ms
8,292 KB
testcase_03 AC 14 ms
8,372 KB
testcase_04 AC 16 ms
7,788 KB
testcase_05 AC 14 ms
8,292 KB
testcase_06 AC 15 ms
8,300 KB
testcase_07 AC 15 ms
8,204 KB
testcase_08 AC 13 ms
8,164 KB
testcase_09 AC 14 ms
8,360 KB
testcase_10 AC 14 ms
8,228 KB
testcase_11 AC 15 ms
8,300 KB
testcase_12 AC 15 ms
8,340 KB
testcase_13 AC 15 ms
8,232 KB
testcase_14 AC 15 ms
8,300 KB
testcase_15 AC 12 ms
8,356 KB
testcase_16 AC 15 ms
8,200 KB
testcase_17 AC 15 ms
8,244 KB
testcase_18 AC 15 ms
8,268 KB
testcase_19 AC 14 ms
8,164 KB
testcase_20 AC 14 ms
8,292 KB
testcase_21 AC 14 ms
8,200 KB
testcase_22 AC 15 ms
8,304 KB
testcase_23 AC 15 ms
8,232 KB
testcase_24 AC 14 ms
7,748 KB
testcase_25 AC 13 ms
7,812 KB
testcase_26 AC 13 ms
8,292 KB
testcase_27 AC 13 ms
8,356 KB
testcase_28 AC 13 ms
8,272 KB
testcase_29 AC 13 ms
8,208 KB
testcase_30 AC 14 ms
8,300 KB
testcase_31 AC 14 ms
8,236 KB
testcase_32 AC 13 ms
8,164 KB
testcase_33 AC 14 ms
8,276 KB
testcase_34 AC 14 ms
8,296 KB
testcase_35 AC 14 ms
8,228 KB
testcase_36 AC 14 ms
8,292 KB
testcase_37 AC 14 ms
8,164 KB
testcase_38 AC 14 ms
8,000 KB
testcase_39 AC 13 ms
8,348 KB
testcase_40 AC 13 ms
8,276 KB
testcase_41 AC 13 ms
7,784 KB
testcase_42 AC 14 ms
8,344 KB
testcase_43 AC 13 ms
8,376 KB
testcase_44 AC 15 ms
8,280 KB
testcase_45 AC 15 ms
8,268 KB
testcase_46 AC 14 ms
8,360 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

B = str(input())
N = int(input())
A = str(input())

if N == 0:
    if B == A:
        print("FAILURE")
    else:
        print("SUCCESS")
elif N == 1:
    if (B[0]==A[1] and B[1]==A[0] and B[2]==A[2]) or (B[0]==A[0] and B[1]==A[2] and B[2]==A[1]):
        print("FAILURE")
    else:
        print("SUCCESS")
elif N == 2:
    if (B==A) or (B[0]==A[2] and B[1]==A[0] and B[2]==A[1]) or (B[0]==A[1] and B[1]==A[2] and B[2]==A[0]):
        print("FAILURE")
    else:
        print("SUCCESS")
else:
    if N%2==0:
        if (B==A) or (B[0]==A[2] and B[1]==A[0] and B[2]==A[1]) or (B[0]==A[1] and B[1]==A[2] and B[2]==A[0]):
            print("FAILURE")
        else:
            print("SUCCESS")
    else:
        if (B[0]==A[1] and B[1]==A[0] and B[2]==A[2]) or (B[0]==A[0] and B[1]==A[2] and B[2]==A[1]) or (B[0]==A[2] and B[1]==A[1] and B[2]==A[0]):
            print("FAILURE")
        else:
            print("SUCCESS")
0