結果
問題 | No.2102 [Cherry Alpha *] Conditional Reflection |
ユーザー | Akijin_007 |
提出日時 | 2022-10-14 22:53:08 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,679 bytes |
コンパイル時間 | 201 ms |
コンパイル使用メモリ | 82,400 KB |
実行使用メモリ | 282,836 KB |
最終ジャッジ日時 | 2024-06-26 16:41:11 |
合計ジャッジ時間 | 45,717 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 37 ms
53,380 KB |
testcase_01 | AC | 37 ms
52,536 KB |
testcase_02 | WA | - |
testcase_03 | WA | - |
testcase_04 | WA | - |
testcase_05 | WA | - |
testcase_06 | WA | - |
testcase_07 | AC | 385 ms
171,932 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 | 312 ms
140,776 KB |
testcase_18 | AC | 524 ms
192,468 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 | 962 ms
117,852 KB |
testcase_43 | AC | 997 ms
118,484 KB |
testcase_44 | AC | 972 ms
118,224 KB |
testcase_45 | AC | 962 ms
118,216 KB |
testcase_46 | AC | 964 ms
118,588 KB |
testcase_47 | AC | 427 ms
188,652 KB |
testcase_48 | AC | 465 ms
189,160 KB |
testcase_49 | AC | 442 ms
187,220 KB |
testcase_50 | AC | 445 ms
186,724 KB |
testcase_51 | AC | 434 ms
188,376 KB |
testcase_52 | AC | 247 ms
168,904 KB |
testcase_53 | AC | 245 ms
169,800 KB |
testcase_54 | AC | 245 ms
169,416 KB |
testcase_55 | AC | 261 ms
148,868 KB |
testcase_56 | AC | 265 ms
148,892 KB |
testcase_57 | AC | 264 ms
148,712 KB |
testcase_58 | AC | 216 ms
139,496 KB |
testcase_59 | WA | - |
testcase_60 | AC | 235 ms
90,496 KB |
testcase_61 | AC | 259 ms
148,304 KB |
testcase_62 | WA | - |
testcase_63 | AC | 246 ms
84,092 KB |
testcase_64 | WA | - |
testcase_65 | WA | - |
testcase_66 | WA | - |
testcase_67 | AC | 385 ms
95,292 KB |
testcase_68 | WA | - |
testcase_69 | AC | 391 ms
103,480 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] == 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) # print(d) for i in range(N): if ans[i] == 1: print("Yes") else: print("No")