結果
問題 | No.197 手品 |
ユーザー | sue_charo |
提出日時 | 2017-04-17 18:21:36 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 70 ms / 1,000 ms |
コード長 | 1,718 bytes |
コンパイル時間 | 572 ms |
コンパイル使用メモリ | 82,432 KB |
実行使用メモリ | 66,304 KB |
最終ジャッジ日時 | 2024-07-20 03:52:05 |
合計ジャッジ時間 | 4,480 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 63 ms
65,664 KB |
testcase_01 | AC | 61 ms
66,304 KB |
testcase_02 | AC | 63 ms
66,048 KB |
testcase_03 | AC | 62 ms
65,664 KB |
testcase_04 | AC | 62 ms
66,176 KB |
testcase_05 | AC | 63 ms
65,792 KB |
testcase_06 | AC | 63 ms
66,304 KB |
testcase_07 | AC | 61 ms
65,792 KB |
testcase_08 | AC | 62 ms
66,048 KB |
testcase_09 | AC | 61 ms
65,664 KB |
testcase_10 | AC | 60 ms
66,048 KB |
testcase_11 | AC | 60 ms
65,792 KB |
testcase_12 | AC | 61 ms
65,792 KB |
testcase_13 | AC | 62 ms
65,920 KB |
testcase_14 | AC | 65 ms
65,792 KB |
testcase_15 | AC | 69 ms
65,792 KB |
testcase_16 | AC | 61 ms
65,920 KB |
testcase_17 | AC | 62 ms
66,304 KB |
testcase_18 | AC | 63 ms
66,176 KB |
testcase_19 | AC | 61 ms
65,920 KB |
testcase_20 | AC | 62 ms
66,176 KB |
testcase_21 | AC | 63 ms
65,920 KB |
testcase_22 | AC | 64 ms
65,664 KB |
testcase_23 | AC | 62 ms
65,792 KB |
testcase_24 | AC | 64 ms
66,176 KB |
testcase_25 | AC | 69 ms
66,176 KB |
testcase_26 | AC | 61 ms
65,792 KB |
testcase_27 | AC | 62 ms
66,048 KB |
testcase_28 | AC | 62 ms
66,048 KB |
testcase_29 | AC | 63 ms
66,176 KB |
testcase_30 | AC | 63 ms
65,920 KB |
testcase_31 | AC | 62 ms
66,048 KB |
testcase_32 | AC | 61 ms
66,176 KB |
testcase_33 | AC | 65 ms
66,304 KB |
testcase_34 | AC | 63 ms
65,792 KB |
testcase_35 | AC | 64 ms
66,048 KB |
testcase_36 | AC | 63 ms
66,048 KB |
testcase_37 | AC | 62 ms
65,792 KB |
testcase_38 | AC | 63 ms
66,048 KB |
testcase_39 | AC | 64 ms
65,792 KB |
testcase_40 | AC | 64 ms
65,792 KB |
testcase_41 | AC | 65 ms
66,048 KB |
testcase_42 | AC | 65 ms
65,792 KB |
testcase_43 | AC | 68 ms
66,048 KB |
testcase_44 | AC | 70 ms
65,792 KB |
testcase_45 | AC | 70 ms
66,176 KB |
testcase_46 | AC | 63 ms
65,664 KB |
ソースコード
# coding: utf-8 import array, bisect, collections, heapq, itertools, math, random, re, string, sys, time sys.setrecursionlimit(10 ** 7) INF = 10 ** 20 MOD = 10 ** 9 + 7 def II(): return int(input()) def ILI(): return list(map(int, input().split())) def IAI(LINE): return [ILI() for __ in range(LINE)] def IDI(): return {key: value for key, value in ILI()} def solve(S_bef, N, S_aft): bef_list = list(S_bef) aft_list = list(S_aft) bef_count = 0 aft_count = 0 for bef, aft in zip(bef_list, aft_list): if bef == "o": bef_count += 1 if aft == "o": aft_count += 1 if bef_count != aft_count: return "SUCCESS" else: if N == 0: if S_bef == S_aft: return "FAILURE" else: return "SUCCESS" elif N == 1: if bef_count == 1: if S_bef == "oxx" and S_aft == "xxo": return "SUCCESS" elif S_bef == "xox" and S_aft == "xox": return "SUCCESS" elif S_bef == "xxo" and S_aft == "oxx": return "SUCCESS" elif bef_count == 2: if S_bef == "xoo" and S_aft == "oox": return "SUCCESS" elif S_bef == "oxo" and S_aft == "oxo": return "SUCCESS" elif S_bef == "oox" and S_aft == "xoo": return "SUCCESS" else: return "FAILURE" return "FAILURE" def main(): S_bef = input() N = II() S_aft = input() print(solve(S_bef, N, S_aft)) if __name__ == "__main__": main()