結果
問題 | No.1254 補強への架け橋 |
ユーザー | Kude |
提出日時 | 2020-10-09 22:55:51 |
言語 | PyPy3 (7.3.15) |
結果 |
RE
|
実行時間 | - |
コード長 | 1,006 bytes |
コンパイル時間 | 234 ms |
コンパイル使用メモリ | 81,920 KB |
実行使用メモリ | 129,580 KB |
最終ジャッジ日時 | 2024-07-20 13:33:21 |
合計ジャッジ時間 | 30,953 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 38 ms
51,712 KB |
testcase_01 | AC | 38 ms
52,352 KB |
testcase_02 | AC | 38 ms
51,968 KB |
testcase_03 | AC | 39 ms
52,224 KB |
testcase_04 | AC | 39 ms
51,968 KB |
testcase_05 | AC | 40 ms
52,096 KB |
testcase_06 | AC | 39 ms
51,840 KB |
testcase_07 | AC | 41 ms
52,096 KB |
testcase_08 | AC | 39 ms
52,224 KB |
testcase_09 | AC | 39 ms
52,224 KB |
testcase_10 | AC | 39 ms
51,840 KB |
testcase_11 | AC | 40 ms
52,096 KB |
testcase_12 | AC | 39 ms
52,096 KB |
testcase_13 | AC | 41 ms
52,608 KB |
testcase_14 | AC | 40 ms
52,224 KB |
testcase_15 | AC | 40 ms
52,352 KB |
testcase_16 | AC | 39 ms
51,968 KB |
testcase_17 | AC | 37 ms
52,480 KB |
testcase_18 | AC | 38 ms
52,480 KB |
testcase_19 | AC | 39 ms
51,968 KB |
testcase_20 | AC | 40 ms
52,224 KB |
testcase_21 | AC | 40 ms
51,968 KB |
testcase_22 | AC | 40 ms
52,352 KB |
testcase_23 | AC | 42 ms
52,096 KB |
testcase_24 | AC | 43 ms
52,480 KB |
testcase_25 | AC | 39 ms
52,352 KB |
testcase_26 | AC | 40 ms
52,608 KB |
testcase_27 | AC | 39 ms
52,480 KB |
testcase_28 | AC | 40 ms
52,352 KB |
testcase_29 | AC | 40 ms
52,224 KB |
testcase_30 | AC | 39 ms
52,224 KB |
testcase_31 | AC | 41 ms
52,352 KB |
testcase_32 | AC | 39 ms
51,968 KB |
testcase_33 | AC | 41 ms
52,480 KB |
testcase_34 | AC | 40 ms
52,608 KB |
testcase_35 | AC | 39 ms
52,480 KB |
testcase_36 | AC | 40 ms
52,608 KB |
testcase_37 | AC | 40 ms
52,736 KB |
testcase_38 | AC | 41 ms
52,480 KB |
testcase_39 | AC | 39 ms
52,352 KB |
testcase_40 | AC | 40 ms
52,352 KB |
testcase_41 | AC | 40 ms
52,480 KB |
testcase_42 | AC | 40 ms
52,480 KB |
testcase_43 | AC | 59 ms
64,512 KB |
testcase_44 | AC | 45 ms
54,528 KB |
testcase_45 | AC | 45 ms
54,144 KB |
testcase_46 | AC | 58 ms
64,128 KB |
testcase_47 | AC | 48 ms
55,168 KB |
testcase_48 | AC | 67 ms
67,584 KB |
testcase_49 | AC | 41 ms
52,736 KB |
testcase_50 | AC | 62 ms
66,432 KB |
testcase_51 | AC | 68 ms
68,352 KB |
testcase_52 | AC | 85 ms
71,264 KB |
testcase_53 | AC | 60 ms
65,280 KB |
testcase_54 | AC | 72 ms
70,272 KB |
testcase_55 | AC | 58 ms
63,488 KB |
testcase_56 | AC | 41 ms
52,992 KB |
testcase_57 | AC | 55 ms
61,440 KB |
testcase_58 | AC | 53 ms
61,312 KB |
testcase_59 | AC | 41 ms
52,864 KB |
testcase_60 | AC | 43 ms
53,888 KB |
testcase_61 | AC | 57 ms
63,488 KB |
testcase_62 | AC | 42 ms
52,864 KB |
testcase_63 | AC | 151 ms
82,816 KB |
testcase_64 | AC | 111 ms
77,952 KB |
testcase_65 | AC | 135 ms
81,148 KB |
testcase_66 | AC | 133 ms
79,872 KB |
testcase_67 | AC | 102 ms
77,192 KB |
testcase_68 | AC | 136 ms
80,460 KB |
testcase_69 | AC | 148 ms
81,280 KB |
testcase_70 | AC | 125 ms
78,208 KB |
testcase_71 | AC | 104 ms
77,308 KB |
testcase_72 | AC | 137 ms
81,932 KB |
testcase_73 | AC | 121 ms
78,208 KB |
testcase_74 | AC | 135 ms
81,280 KB |
testcase_75 | AC | 132 ms
79,724 KB |
testcase_76 | AC | 80 ms
75,776 KB |
testcase_77 | AC | 135 ms
79,488 KB |
testcase_78 | AC | 169 ms
82,296 KB |
testcase_79 | AC | 155 ms
82,560 KB |
testcase_80 | AC | 147 ms
82,048 KB |
testcase_81 | AC | 151 ms
82,816 KB |
testcase_82 | AC | 141 ms
81,604 KB |
testcase_83 | AC | 552 ms
127,944 KB |
testcase_84 | AC | 533 ms
121,144 KB |
testcase_85 | AC | 353 ms
104,292 KB |
testcase_86 | AC | 476 ms
115,352 KB |
testcase_87 | AC | 543 ms
118,720 KB |
testcase_88 | AC | 170 ms
84,904 KB |
testcase_89 | AC | 552 ms
128,428 KB |
testcase_90 | AC | 355 ms
104,456 KB |
testcase_91 | AC | 304 ms
99,280 KB |
testcase_92 | AC | 214 ms
93,152 KB |
testcase_93 | AC | 425 ms
113,684 KB |
testcase_94 | AC | 402 ms
110,928 KB |
testcase_95 | AC | 410 ms
111,576 KB |
testcase_96 | AC | 498 ms
121,188 KB |
testcase_97 | AC | 282 ms
96,688 KB |
testcase_98 | AC | 543 ms
121,544 KB |
testcase_99 | AC | 348 ms
102,968 KB |
testcase_100 | AC | 547 ms
129,580 KB |
testcase_101 | AC | 230 ms
91,520 KB |
testcase_102 | AC | 161 ms
83,032 KB |
testcase_103 | AC | 218 ms
91,904 KB |
testcase_104 | AC | 291 ms
95,232 KB |
testcase_105 | AC | 443 ms
114,248 KB |
testcase_106 | AC | 306 ms
98,312 KB |
testcase_107 | AC | 534 ms
128,024 KB |
testcase_108 | AC | 541 ms
123,104 KB |
testcase_109 | AC | 443 ms
114,656 KB |
testcase_110 | AC | 423 ms
110,492 KB |
testcase_111 | AC | 435 ms
111,732 KB |
testcase_112 | AC | 261 ms
95,276 KB |
testcase_113 | AC | 450 ms
112,036 KB |
testcase_114 | AC | 300 ms
97,360 KB |
testcase_115 | AC | 183 ms
84,992 KB |
testcase_116 | AC | 337 ms
100,588 KB |
testcase_117 | AC | 264 ms
95,032 KB |
testcase_118 | AC | 554 ms
121,584 KB |
testcase_119 | AC | 358 ms
102,872 KB |
testcase_120 | AC | 509 ms
117,940 KB |
testcase_121 | AC | 235 ms
93,708 KB |
testcase_122 | AC | 327 ms
99,832 KB |
testcase_123 | AC | 39 ms
52,096 KB |
testcase_124 | RE | - |
testcase_125 | RE | - |
ソースコード
n = int(input()) to = [[] for _ in range(n)] bmap = {} for i in range(1, n+1): a, b = map(int, input().split()) a -= 1 b -= 1 to[a].append(b) to[b].append(a) bmap[(a, b)] = bmap[(b, a)] = i num = [-1] * n low = [-1] * n visited = [False] * n ans = 0 nm = 1 def dfs(v, p=-1): global nm visited[v] = True num[v] = nm nm += 1 lw = num[v] for w in to[v]: if w == p: continue if not visited[w]: dfs(w, v) lw = min(lw, low[w]) else: lw = min(lw, num[w]) low[v] = lw dfs(0) ans = set(range(1, n+1)) visited = [False] * n def dfs2(v, p=-1): visited[v] = True for w in to[v]: if w == p: continue if not visited[w]: dfs2(w, v) if low[w] > num[v]: if (v, w) in bmap: tmp = bmap[(v, w)] if tmp in ans: ans.remove(tmp) dfs2(0) print(len(ans)) print(*ans)