結果
問題 | No.2102 [Cherry Alpha *] Conditional Reflection |
ユーザー | Akijin_007 |
提出日時 | 2022-10-14 22:50:04 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,668 bytes |
コンパイル時間 | 192 ms |
コンパイル使用メモリ | 82,228 KB |
実行使用メモリ | 282,884 KB |
最終ジャッジ日時 | 2024-06-26 16:32:13 |
合計ジャッジ時間 | 46,801 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 37 ms
52,580 KB |
testcase_01 | AC | 39 ms
53,540 KB |
testcase_02 | WA | - |
testcase_03 | WA | - |
testcase_04 | WA | - |
testcase_05 | WA | - |
testcase_06 | WA | - |
testcase_07 | AC | 395 ms
171,804 KB |
testcase_08 | WA | - |
testcase_09 | WA | - |
testcase_10 | WA | - |
testcase_11 | WA | - |
testcase_12 | WA | - |
testcase_13 | WA | - |
testcase_14 | WA | - |
testcase_15 | WA | - |
testcase_16 | WA | - |
testcase_17 | AC | 311 ms
141,156 KB |
testcase_18 | AC | 541 ms
192,472 KB |
testcase_19 | WA | - |
testcase_20 | WA | - |
testcase_21 | WA | - |
testcase_22 | WA | - |
testcase_23 | WA | - |
testcase_24 | WA | - |
testcase_25 | WA | - |
testcase_26 | WA | - |
testcase_27 | WA | - |
testcase_28 | WA | - |
testcase_29 | WA | - |
testcase_30 | WA | - |
testcase_31 | WA | - |
testcase_32 | WA | - |
testcase_33 | WA | - |
testcase_34 | WA | - |
testcase_35 | WA | - |
testcase_36 | WA | - |
testcase_37 | WA | - |
testcase_38 | WA | - |
testcase_39 | WA | - |
testcase_40 | WA | - |
testcase_41 | WA | - |
testcase_42 | AC | 974 ms
117,840 KB |
testcase_43 | AC | 1,004 ms
118,484 KB |
testcase_44 | AC | 978 ms
118,348 KB |
testcase_45 | AC | 1,018 ms
118,232 KB |
testcase_46 | AC | 1,037 ms
118,584 KB |
testcase_47 | AC | 447 ms
188,528 KB |
testcase_48 | AC | 474 ms
189,024 KB |
testcase_49 | AC | 452 ms
186,964 KB |
testcase_50 | AC | 457 ms
186,452 KB |
testcase_51 | AC | 437 ms
188,488 KB |
testcase_52 | AC | 257 ms
169,268 KB |
testcase_53 | AC | 255 ms
169,864 KB |
testcase_54 | AC | 256 ms
169,412 KB |
testcase_55 | AC | 271 ms
148,756 KB |
testcase_56 | AC | 271 ms
148,972 KB |
testcase_57 | AC | 267 ms
148,672 KB |
testcase_58 | AC | 226 ms
139,624 KB |
testcase_59 | WA | - |
testcase_60 | AC | 242 ms
90,760 KB |
testcase_61 | AC | 276 ms
148,476 KB |
testcase_62 | WA | - |
testcase_63 | AC | 256 ms
84,200 KB |
testcase_64 | WA | - |
testcase_65 | WA | - |
testcase_66 | WA | - |
testcase_67 | AC | 405 ms
95,172 KB |
testcase_68 | WA | - |
testcase_69 | AC | 409 ms
103,612 KB |
ソースコード
#int(input()) #map(int, input().split()) #list(map(int, input().split())) N = int(input()) S = [0] * N for i in range(N): S[i] = input() d = dict() ans = [0] * N def check(x, y): if len(x) != len(y): return 0 dif = [] for i in range(len(x)): if x[i] != y[i]: dif.append(i) if len(dif) == 0: return 1 elif len(dif) == 2: u = dif[0] v = dif[1] if u + 1 == v and x[u] == y[v] and x[v] and y[u]: return 1 else: return 0 else: return 0 for i in range(N): a = [] u, v = divmod(len(S[i]), 2) u += v for j in range(u): s = S[i][2*j:2*j+2] if len(s) == 1: a.append(s) continue if s[0] < s[1]: a.append(s) else: a.append(s[1] + s[0]) t = tuple(a) if t not in d: d[t] = [i] else: for x in d[t]: if check(S[i], S[x]): ans[i] = 1 break d[t].append(i) d = dict() for i in range(N): if ans[i] == 1: continue a = [S[i][0]] u, v = divmod(len(S[i]), 2) for j in range(u): s = S[i][2*j+1:2*j+3] if len(s) == 1: a.append(s) continue if s[0] < s[1]: a.append(s) else: a.append(s[1] + s[0]) t = tuple(a) if t not in d: d[t] = [i] else: for x in d[t]: if check(S[i], S[x]): ans[i] = 1 break d[t].append(i) for i in range(N): if ans[i] == 1: print("Yes") else: print("No")