結果
問題 | No.197 手品 |
ユーザー | sue_charo |
提出日時 | 2017-04-17 18:19:12 |
言語 | Python3 (3.12.2 + numpy 1.26.4 + scipy 1.12.0) |
結果 |
AC
|
実行時間 | 38 ms / 1,000 ms |
コード長 | 1,718 bytes |
コンパイル時間 | 111 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 11,520 KB |
最終ジャッジ日時 | 2024-07-20 03:51:28 |
合計ジャッジ時間 | 2,875 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 32 ms
11,264 KB |
testcase_01 | AC | 33 ms
11,264 KB |
testcase_02 | AC | 35 ms
11,264 KB |
testcase_03 | AC | 31 ms
11,264 KB |
testcase_04 | AC | 31 ms
11,264 KB |
testcase_05 | AC | 32 ms
11,264 KB |
testcase_06 | AC | 33 ms
11,264 KB |
testcase_07 | AC | 32 ms
11,264 KB |
testcase_08 | AC | 32 ms
11,264 KB |
testcase_09 | AC | 34 ms
11,264 KB |
testcase_10 | AC | 38 ms
11,392 KB |
testcase_11 | AC | 32 ms
11,264 KB |
testcase_12 | AC | 31 ms
11,264 KB |
testcase_13 | AC | 31 ms
11,264 KB |
testcase_14 | AC | 32 ms
11,264 KB |
testcase_15 | AC | 30 ms
11,264 KB |
testcase_16 | AC | 30 ms
11,264 KB |
testcase_17 | AC | 30 ms
11,392 KB |
testcase_18 | AC | 32 ms
11,520 KB |
testcase_19 | AC | 32 ms
11,264 KB |
testcase_20 | AC | 32 ms
11,264 KB |
testcase_21 | AC | 34 ms
11,264 KB |
testcase_22 | AC | 31 ms
11,264 KB |
testcase_23 | AC | 31 ms
11,264 KB |
testcase_24 | AC | 31 ms
11,264 KB |
testcase_25 | AC | 31 ms
11,392 KB |
testcase_26 | AC | 31 ms
11,264 KB |
testcase_27 | AC | 31 ms
11,264 KB |
testcase_28 | AC | 31 ms
11,264 KB |
testcase_29 | AC | 30 ms
11,264 KB |
testcase_30 | AC | 33 ms
11,264 KB |
testcase_31 | AC | 31 ms
11,264 KB |
testcase_32 | AC | 31 ms
11,392 KB |
testcase_33 | AC | 31 ms
11,264 KB |
testcase_34 | AC | 31 ms
11,392 KB |
testcase_35 | AC | 30 ms
11,392 KB |
testcase_36 | AC | 29 ms
11,392 KB |
testcase_37 | AC | 31 ms
11,264 KB |
testcase_38 | AC | 31 ms
11,264 KB |
testcase_39 | AC | 31 ms
11,264 KB |
testcase_40 | AC | 31 ms
11,264 KB |
testcase_41 | AC | 31 ms
11,264 KB |
testcase_42 | AC | 32 ms
11,264 KB |
testcase_43 | AC | 33 ms
11,392 KB |
testcase_44 | AC | 29 ms
11,264 KB |
testcase_45 | AC | 31 ms
11,264 KB |
testcase_46 | AC | 30 ms
11,264 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()