結果
問題 | No.1254 補強への架け橋 |
ユーザー | Kude |
提出日時 | 2020-10-09 22:53:19 |
言語 | PyPy3 (7.3.15) |
結果 |
RE
|
実行時間 | - |
コード長 | 899 bytes |
コンパイル時間 | 358 ms |
コンパイル使用メモリ | 81,920 KB |
実行使用メモリ | 129,336 KB |
最終ジャッジ日時 | 2024-07-20 13:28:34 |
合計ジャッジ時間 | 27,149 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 35 ms
51,840 KB |
testcase_01 | AC | 36 ms
51,840 KB |
testcase_02 | AC | 35 ms
51,712 KB |
testcase_03 | AC | 42 ms
51,712 KB |
testcase_04 | AC | 41 ms
52,224 KB |
testcase_05 | AC | 39 ms
51,840 KB |
testcase_06 | AC | 40 ms
51,840 KB |
testcase_07 | AC | 39 ms
51,968 KB |
testcase_08 | AC | 41 ms
51,968 KB |
testcase_09 | AC | 37 ms
52,096 KB |
testcase_10 | AC | 41 ms
52,096 KB |
testcase_11 | AC | 39 ms
52,224 KB |
testcase_12 | AC | 36 ms
51,840 KB |
testcase_13 | AC | 37 ms
52,352 KB |
testcase_14 | AC | 38 ms
52,608 KB |
testcase_15 | AC | 37 ms
52,224 KB |
testcase_16 | AC | 37 ms
52,352 KB |
testcase_17 | AC | 37 ms
51,840 KB |
testcase_18 | AC | 37 ms
51,840 KB |
testcase_19 | AC | 37 ms
51,968 KB |
testcase_20 | AC | 37 ms
52,352 KB |
testcase_21 | AC | 38 ms
52,096 KB |
testcase_22 | AC | 37 ms
52,352 KB |
testcase_23 | AC | 41 ms
52,096 KB |
testcase_24 | AC | 40 ms
52,608 KB |
testcase_25 | AC | 36 ms
52,224 KB |
testcase_26 | AC | 39 ms
52,480 KB |
testcase_27 | AC | 36 ms
52,352 KB |
testcase_28 | AC | 38 ms
52,352 KB |
testcase_29 | AC | 37 ms
52,096 KB |
testcase_30 | AC | 40 ms
52,096 KB |
testcase_31 | AC | 43 ms
52,352 KB |
testcase_32 | AC | 37 ms
52,480 KB |
testcase_33 | AC | 37 ms
52,224 KB |
testcase_34 | AC | 38 ms
52,352 KB |
testcase_35 | AC | 38 ms
52,224 KB |
testcase_36 | AC | 38 ms
52,480 KB |
testcase_37 | AC | 38 ms
52,352 KB |
testcase_38 | AC | 36 ms
52,352 KB |
testcase_39 | AC | 36 ms
52,224 KB |
testcase_40 | AC | 42 ms
52,352 KB |
testcase_41 | AC | 37 ms
52,352 KB |
testcase_42 | AC | 37 ms
52,096 KB |
testcase_43 | AC | 56 ms
64,256 KB |
testcase_44 | AC | 44 ms
54,144 KB |
testcase_45 | AC | 47 ms
54,016 KB |
testcase_46 | AC | 64 ms
64,128 KB |
testcase_47 | AC | 50 ms
55,040 KB |
testcase_48 | AC | 69 ms
66,688 KB |
testcase_49 | AC | 43 ms
52,864 KB |
testcase_50 | AC | 70 ms
66,560 KB |
testcase_51 | AC | 76 ms
67,456 KB |
testcase_52 | AC | 71 ms
69,888 KB |
testcase_53 | AC | 62 ms
64,768 KB |
testcase_54 | AC | 69 ms
69,632 KB |
testcase_55 | AC | 55 ms
63,104 KB |
testcase_56 | AC | 39 ms
52,864 KB |
testcase_57 | AC | 50 ms
61,440 KB |
testcase_58 | AC | 50 ms
61,184 KB |
testcase_59 | AC | 37 ms
52,480 KB |
testcase_60 | AC | 41 ms
53,888 KB |
testcase_61 | AC | 55 ms
63,488 KB |
testcase_62 | AC | 39 ms
52,992 KB |
testcase_63 | AC | 136 ms
82,560 KB |
testcase_64 | AC | 107 ms
77,440 KB |
testcase_65 | AC | 126 ms
81,152 KB |
testcase_66 | AC | 122 ms
79,744 KB |
testcase_67 | AC | 97 ms
77,372 KB |
testcase_68 | AC | 119 ms
80,384 KB |
testcase_69 | AC | 131 ms
81,536 KB |
testcase_70 | AC | 121 ms
78,208 KB |
testcase_71 | AC | 98 ms
77,436 KB |
testcase_72 | AC | 123 ms
81,152 KB |
testcase_73 | AC | 113 ms
77,952 KB |
testcase_74 | AC | 123 ms
81,024 KB |
testcase_75 | AC | 120 ms
79,744 KB |
testcase_76 | AC | 78 ms
74,624 KB |
testcase_77 | AC | 123 ms
79,616 KB |
testcase_78 | AC | 151 ms
82,304 KB |
testcase_79 | AC | 134 ms
82,304 KB |
testcase_80 | AC | 130 ms
82,048 KB |
testcase_81 | AC | 132 ms
82,208 KB |
testcase_82 | AC | 132 ms
81,664 KB |
testcase_83 | AC | 513 ms
127,956 KB |
testcase_84 | AC | 470 ms
121,128 KB |
testcase_85 | AC | 300 ms
104,168 KB |
testcase_86 | AC | 398 ms
115,112 KB |
testcase_87 | AC | 437 ms
118,632 KB |
testcase_88 | AC | 144 ms
84,864 KB |
testcase_89 | AC | 465 ms
128,044 KB |
testcase_90 | AC | 312 ms
104,596 KB |
testcase_91 | AC | 276 ms
99,240 KB |
testcase_92 | AC | 183 ms
93,184 KB |
testcase_93 | AC | 366 ms
114,072 KB |
testcase_94 | AC | 348 ms
111,188 KB |
testcase_95 | AC | 373 ms
111,064 KB |
testcase_96 | AC | 445 ms
120,860 KB |
testcase_97 | AC | 257 ms
96,040 KB |
testcase_98 | AC | 453 ms
121,284 KB |
testcase_99 | AC | 305 ms
102,320 KB |
testcase_100 | AC | 476 ms
129,336 KB |
testcase_101 | AC | 189 ms
91,392 KB |
testcase_102 | AC | 141 ms
82,944 KB |
testcase_103 | AC | 187 ms
92,160 KB |
testcase_104 | AC | 267 ms
95,360 KB |
testcase_105 | AC | 377 ms
113,856 KB |
testcase_106 | AC | 267 ms
97,708 KB |
testcase_107 | AC | 472 ms
127,816 KB |
testcase_108 | AC | 473 ms
122,836 KB |
testcase_109 | AC | 382 ms
113,664 KB |
testcase_110 | AC | 364 ms
110,376 KB |
testcase_111 | AC | 362 ms
111,096 KB |
testcase_112 | AC | 216 ms
94,976 KB |
testcase_113 | AC | 362 ms
111,456 KB |
testcase_114 | AC | 256 ms
96,704 KB |
testcase_115 | AC | 154 ms
84,864 KB |
testcase_116 | AC | 280 ms
99,708 KB |
testcase_117 | AC | 224 ms
95,232 KB |
testcase_118 | AC | 462 ms
120,696 KB |
testcase_119 | AC | 302 ms
102,724 KB |
testcase_120 | AC | 429 ms
117,836 KB |
testcase_121 | AC | 209 ms
93,696 KB |
testcase_122 | AC | 292 ms
99,644 KB |
testcase_123 | AC | 36 ms
51,840 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]: ans.remove(bmap[(v, w)]) dfs2(0) print(len(ans)) print(*ans)