QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#227162 | #2543. Edges, Colors and MST | JooDdae | AC ✓ | 60ms | 20992kb | C++20 | 1.4kb | 2023-10-27 00:07:14 | 2023-10-27 00:07:15 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int n, m, ans[200200], lev[200200], p[200200];
vector<array<int, 2>> v[200200];
array<int, 2> par[200200];
int find(int x) {
if(x == p[x]) return x;
return p[x] = find(p[x]);
}
void dfs(int u, int p) {
lev[u] = lev[p]+1;
for(auto [x, id] : v[u]) if(x != p) {
par[x] = {u, id};
dfs(x, u);
}
}
int main() {
cin.tie(0)->sync_with_stdio(0);
cin >> n >> m;
vector<array<int, 3>> edge;
for(int i=1;i<=m;i++) {
int x, y, c; cin >> x >> y >> c;
if(c) v[x].push_back({y, i}), v[y].push_back({x, i});
else edge.push_back({x, y, i});
}
dfs(1, 0);
iota(p+1, p+1+n, 1);
int last = 1, cnt = 0;
for(auto [x, y, i] : edge) {
while(last < i) {
if(!ans[last]) ans[last] = ++cnt;
last++;
}
x = find(x), y = find(y);
vector<int> l;
while(x != y) {
if(lev[x] < lev[y]) swap(x, y);
l.push_back(par[x][1]), x = p[x] = find(par[x][0]);
}
sort(l.begin(), l.end());
for(auto x : l) if(!ans[x]) ans[x] = ++cnt;
ans[i] = ++cnt;
}
while(last <= m) {
if(!ans[last]) ans[last] = ++cnt;
last++;
}
for(int i=1;i<=m;i++) cout << ans[i] << " ";
}
详细
Test #1:
score: 100
Accepted
time: 1ms
memory: 9788kb
input:
4 5 1 2 0 2 3 1 3 4 1 2 4 0 1 3 1
output:
3 1 4 5 2
result:
ok 5 number(s): "3 1 4 5 2"
Test #2:
score: 0
Accepted
time: 1ms
memory: 9776kb
input:
9 15 1 4 1 3 5 1 3 9 0 1 3 0 2 5 0 5 8 0 6 9 0 8 9 0 1 7 1 1 8 1 6 8 1 4 9 1 2 4 1 3 4 1 4 6 0
output:
1 2 5 6 8 10 12 13 14 9 11 3 7 4 15
result:
ok 15 numbers
Test #3:
score: 0
Accepted
time: 1ms
memory: 9776kb
input:
8 15 4 7 1 3 6 1 1 5 0 5 7 0 4 5 1 1 2 0 4 8 1 1 3 0 1 4 1 2 4 0 3 8 1 6 8 0 2 5 1 7 8 0 3 5 0
output:
1 2 5 6 3 8 9 11 4 12 10 13 7 14 15
result:
ok 15 numbers
Test #4:
score: 0
Accepted
time: 2ms
memory: 9640kb
input:
6 13 4 5 0 5 6 0 1 2 0 1 6 0 1 5 0 2 3 0 3 5 0 3 6 0 4 6 1 2 4 1 2 5 1 1 3 1 1 4 1
output:
3 5 7 8 9 11 12 13 4 1 2 10 6
result:
ok 13 numbers
Test #5:
score: 0
Accepted
time: 0ms
memory: 9868kb
input:
9 22 2 4 1 5 6 1 3 6 0 1 2 1 1 7 0 2 3 0 7 8 0 3 8 0 6 7 0 5 7 1 8 9 0 1 5 1 3 5 1 2 8 0 1 4 0 1 9 1 1 8 0 5 8 1 2 6 0 3 9 0 5 9 0 2 9 0
output:
1 2 4 5 8 9 11 12 13 6 15 7 3 16 17 14 18 10 19 20 21 22
result:
ok 22 numbers
Test #6:
score: 0
Accepted
time: 0ms
memory: 9940kb
input:
4 6 1 2 1 3 4 0 1 3 1 2 4 0 1 4 1 2 3 0
output:
1 4 2 5 3 6
result:
ok 6 numbers
Test #7:
score: 0
Accepted
time: 1ms
memory: 9632kb
input:
4 6 1 3 0 2 3 0 1 4 0 2 4 1 3 4 1 1 2 1
output:
4 5 6 1 2 3
result:
ok 6 numbers
Test #8:
score: 0
Accepted
time: 1ms
memory: 9944kb
input:
18 20 2 15 1 9 15 1 4 11 1 2 8 0 8 12 1 4 7 1 1 2 0 9 18 1 13 15 1 1 4 1 4 17 1 12 15 1 5 10 0 5 15 1 4 14 1 2 3 1 10 17 1 16 17 1 6 14 1 2 17 1
output:
1 2 3 6 4 7 11 12 13 8 9 5 16 14 17 18 15 19 20 10
result:
ok 20 numbers
Test #9:
score: 0
Accepted
time: 1ms
memory: 10076kb
input:
14 28 4 12 0 6 8 1 3 10 1 3 14 1 5 10 0 10 11 0 7 13 1 1 11 0 1 2 1 7 9 0 8 14 0 4 14 1 4 11 1 2 3 1 12 14 0 3 13 1 7 10 0 8 9 0 1 7 0 12 13 1 10 13 0 2 6 1 8 13 0 4 5 0 6 11 0 5 6 1 4 10 0 9 10 1
output:
5 6 7 1 11 13 14 16 15 18 19 2 12 8 20 3 21 22 23 4 24 9 25 26 27 10 28 17
result:
ok 28 numbers
Test #10:
score: 0
Accepted
time: 1ms
memory: 9752kb
input:
12 30 4 10 0 7 10 0 2 5 0 5 12 0 4 5 0 10 11 0 3 11 0 6 10 0 3 10 0 1 4 0 3 7 0 3 12 0 2 7 0 2 4 0 6 8 0 2 6 0 9 11 0 8 12 0 4 8 0 4 11 1 2 10 1 3 8 1 2 12 1 5 9 1 4 12 1 1 9 1 3 6 1 2 3 1 6 7 1 3 9 1
output:
4 8 11 12 13 15 16 17 18 20 21 22 23 24 26 27 28 29 30 14 1 25 2 9 3 19 5 6 7 10
result:
ok 30 numbers
Test #11:
score: 0
Accepted
time: 1ms
memory: 10244kb
input:
73 182 4 55 0 5 70 0 30 41 1 1 62 0 12 25 0 15 38 1 35 71 1 5 61 1 2 28 0 4 37 0 36 47 0 15 22 1 7 12 0 42 66 0 23 58 1 33 46 0 2 46 0 6 20 0 54 65 0 57 62 0 38 41 0 12 40 0 25 72 1 46 62 0 35 37 1 20 29 0 10 40 1 20 44 0 21 29 0 2 65 0 25 67 0 1 70 0 36 65 1 22 66 1 4 6 0 20 66 0 16 46 0 39 50 1 7 ...
output:
10 16 17 19 25 11 26 27 33 37 38 39 44 47 48 53 54 56 57 58 59 60 61 62 63 64 49 66 67 68 69 70 28 45 71 72 74 75 76 77 29 79 81 82 85 86 87 88 91 93 30 94 97 99 101 102 103 105 106 1 107 108 109 111 112 50 113 12 20 115 116 117 118 120 121 13 21 122 123 124 125 2 127 128 129 83 40 14 3 130 132 95 2...
result:
ok 182 numbers
Test #12:
score: 0
Accepted
time: 1ms
memory: 10028kb
input:
27 128 1 2 0 14 20 0 22 25 0 14 18 0 5 23 0 8 25 0 4 20 0 24 26 0 2 13 0 2 3 0 13 27 0 3 11 0 4 9 0 6 15 0 5 16 0 13 20 0 12 16 0 7 17 0 3 4 0 7 25 0 24 25 0 7 10 0 20 24 0 7 22 0 17 19 0 10 25 0 2 23 0 3 23 0 16 25 0 17 21 0 20 22 0 8 18 0 4 27 0 2 5 0 9 25 0 8 26 0 23 24 0 2 17 0 2 10 0 7 8 0 10 1...
output:
6 10 14 16 22 24 25 29 31 32 33 34 36 37 38 39 40 42 43 44 45 47 48 49 50 51 52 53 54 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 12...
result:
ok 128 numbers
Test #13:
score: 0
Accepted
time: 0ms
memory: 9984kb
input:
72 543 57 62 1 30 61 0 20 39 0 2 23 0 17 48 0 7 38 0 14 19 1 24 38 0 23 65 1 1 11 0 11 16 1 38 51 1 36 46 1 41 50 0 18 61 1 12 20 0 5 49 0 21 26 1 1 41 1 16 47 0 42 59 0 38 55 0 15 30 0 31 55 0 64 65 0 59 60 0 63 72 1 64 67 1 15 16 0 45 47 0 18 26 0 10 71 1 21 43 0 17 52 0 1 34 0 26 60 0 14 41 1 7 4...
output:
1 12 16 20 26 30 31 35 36 37 38 27 39 41 42 45 48 17 21 51 53 54 55 57 59 62 63 58 64 66 67 68 70 72 74 75 76 77 78 79 81 82 83 84 85 86 87 88 90 91 92 94 22 95 96 97 98 99 100 101 103 104 105 89 106 108 109 110 111 115 116 117 119 120 121 122 123 124 126 128 118 129 130 131 43 132 133 134 135 136 1...
result:
ok 543 numbers
Test #14:
score: 0
Accepted
time: 1ms
memory: 10164kb
input:
28 378 21 24 0 23 26 0 15 21 0 5 28 0 6 17 0 2 15 0 2 4 0 1 21 0 3 13 0 22 23 0 4 25 0 26 27 0 11 28 0 2 13 0 19 24 0 3 8 0 4 12 0 17 27 0 5 14 0 6 20 0 19 20 0 9 24 0 24 25 0 8 25 0 10 17 0 3 22 0 18 20 0 6 7 0 7 22 0 7 9 0 6 14 0 4 16 0 1 25 0 1 14 0 2 12 0 8 11 0 21 25 0 4 23 0 23 28 0 21 22 0 9 ...
output:
5 11 13 19 21 22 24 25 27 28 31 33 36 37 38 39 41 42 43 44 45 46 47 48 50 51 53 54 55 56 57 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 1...
result:
ok 378 numbers
Test #15:
score: 0
Accepted
time: 1ms
memory: 10372kb
input:
398 1144 53 212 0 315 383 0 38 115 0 90 249 1 287 320 1 128 208 0 20 224 1 254 317 0 189 224 0 183 309 1 333 355 0 48 381 0 246 334 0 75 233 0 147 157 0 36 320 1 116 191 1 285 320 1 17 98 0 139 297 0 156 390 0 132 234 0 161 366 1 241 361 0 3 196 0 108 393 0 13 265 0 59 304 0 9 396 0 109 398 0 23 194...
output:
8 19 24 25 26 34 35 38 43 44 47 51 56 62 66 67 68 69 77 84 87 90 91 92 98 103 109 113 118 128 129 130 138 142 143 145 153 157 93 160 52 163 27 164 166 170 173 180 183 184 187 189 196 197 202 205 208 211 215 216 219 224 226 229 146 232 181 235 236 147 237 241 167 242 244 245 248 220 250 252 254 63 25...
result:
ok 1144 numbers
Test #16:
score: 0
Accepted
time: 1ms
memory: 9748kb
input:
814 1240 66 223 0 482 610 0 655 811 0 145 341 0 157 548 0 390 645 0 316 516 0 167 549 0 435 755 0 21 507 0 639 747 0 179 649 0 43 189 0 193 197 0 257 353 0 155 554 0 205 649 0 247 551 0 83 129 0 255 380 0 318 407 0 210 665 0 117 149 0 151 550 0 603 714 0 213 319 0 239 760 0 527 733 0 255 393 0 342 5...
output:
12 23 34 39 48 53 62 68 71 76 83 89 94 100 104 112 117 120 126 140 145 148 152 158 165 169 173 185 187 188 191 195 197 201 205 211 217 219 224 229 231 234 236 241 245 246 249 255 259 263 266 269 272 278 281 287 289 295 298 303 308 310 312 314 318 319 325 328 332 340 341 342 345 351 354 355 359 360 3...
result:
ok 1240 numbers
Test #17:
score: 0
Accepted
time: 7ms
memory: 11060kb
input:
464 88932 304 461 0 168 293 0 230 363 0 383 451 0 3 373 0 190 363 0 51 304 0 20 145 0 91 147 0 211 307 0 232 463 0 122 279 0 88 177 0 123 287 0 101 439 0 266 292 0 162 311 0 196 213 0 94 456 0 349 464 0 363 420 0 47 306 0 215 310 0 198 241 0 162 175 0 150 391 0 195 457 0 34 254 0 366 408 0 334 420 0...
output:
6 15 23 32 36 39 47 54 61 67 71 75 78 84 87 95 104 108 112 115 118 121 125 129 133 140 142 145 147 149 151 156 158 164 168 176 178 180 185 188 190 192 197 201 202 207 210 213 217 220 222 225 229 231 235 242 245 249 251 254 255 258 263 265 270 272 273 275 276 280 288 290 292 296 297 298 300 303 304 3...
result:
ok 88932 numbers
Test #18:
score: 0
Accepted
time: 3ms
memory: 9956kb
input:
725 31440 12 245 0 524 702 0 28 493 0 279 296 0 568 703 0 4 143 0 9 368 0 349 701 0 350 669 0 109 541 0 415 638 0 120 248 0 204 343 0 179 467 0 357 669 0 557 651 0 488 536 0 676 694 0 275 683 0 188 403 0 32 431 0 114 500 0 364 704 0 275 403 0 346 354 0 222 520 0 478 705 0 348 608 0 441 547 0 43 46 0...
output:
13 24 29 34 43 51 62 71 82 87 92 98 106 113 117 126 130 135 140 145 150 155 163 164 173 182 184 190 197 201 205 208 213 215 219 221 225 230 233 240 243 246 253 258 260 265 267 271 275 278 280 286 291 292 294 299 302 305 307 312 316 318 323 326 328 332 333 335 339 341 346 349 355 356 358 359 363 365 ...
result:
ok 31440 numbers
Test #19:
score: 0
Accepted
time: 27ms
memory: 13968kb
input:
845 165225 168 537 0 349 418 0 89 368 0 609 830 0 305 604 0 187 533 0 591 674 0 80 700 0 51 257 0 526 536 0 370 649 0 10 425 0 337 338 0 271 650 0 404 410 0 133 701 0 62 135 0 137 628 0 293 354 0 181 771 0 505 820 0 322 324 0 178 831 0 294 371 0 50 193 0 632 818 0 485 564 0 240 706 0 210 330 0 492 6...
output:
15 25 36 48 61 67 80 86 93 97 105 114 117 125 136 144 151 156 166 175 182 185 188 191 194 201 206 213 220 225 227 234 241 245 251 259 261 266 272 279 280 284 288 289 295 300 305 308 312 316 321 327 332 334 338 343 352 356 362 365 366 368 371 373 377 381 386 390 396 399 403 405 408 413 415 418 421 42...
result:
ok 165225 numbers
Test #20:
score: 0
Accepted
time: 4ms
memory: 10136kb
input:
167 13861 98 112 0 80 127 0 20 78 0 56 105 0 94 135 0 1 134 0 117 131 0 32 149 0 6 75 0 26 32 0 53 132 0 77 165 0 13 26 0 67 167 0 94 96 0 37 92 0 26 56 0 58 111 0 22 119 0 39 84 0 70 104 0 48 82 0 5 100 0 31 128 0 63 84 0 88 101 0 6 44 0 37 166 0 42 165 0 4 102 0 18 145 0 1 9 0 79 106 0 57 162 0 9 ...
output:
13 21 31 38 42 50 58 61 65 68 70 75 76 78 79 84 85 87 90 93 97 100 104 105 106 109 112 113 114 118 123 124 127 129 131 132 134 137 139 142 145 151 152 153 154 157 158 160 163 166 169 170 172 175 176 178 180 182 184 185 186 188 189 191 194 196 198 199 200 201 202 203 205 207 208 209 210 212 213 214 2...
result:
ok 13861 numbers
Test #21:
score: 0
Accepted
time: 31ms
memory: 12460kb
input:
1702 200000 79 1200 0 76 533 0 316 1001 0 307 1346 0 691 1491 0 1108 1459 0 498 1252 0 1072 1695 0 347 1079 0 9 128 0 259 1147 0 780 1007 0 633 971 0 721 820 0 196 1647 0 515 951 0 498 733 0 126 570 0 187 1452 0 413 761 0 93 1008 0 91 1615 0 842 1210 0 315 405 0 314 1222 0 1014 1306 0 95 1323 0 893 ...
output:
10 18 26 40 48 59 71 79 88 97 102 114 120 134 143 151 155 162 166 171 177 181 189 195 200 209 215 226 232 239 244 251 256 260 262 270 278 287 291 296 302 308 318 320 327 336 342 345 352 356 361 366 373 377 386 388 391 396 402 408 412 417 422 426 431 436 443 444 449 455 457 461 462 463 465 474 478 48...
result:
ok 200000 numbers
Test #22:
score: 0
Accepted
time: 32ms
memory: 12728kb
input:
1146 200000 17 361 0 66 352 0 277 972 0 43 1052 0 350 562 0 780 933 0 346 1013 0 747 1084 0 656 1051 0 820 828 0 60 527 0 420 631 0 866 999 0 593 681 0 208 1003 0 401 699 0 757 937 0 579 799 0 532 766 0 383 627 0 407 497 0 701 804 0 96 967 0 968 1076 0 293 954 0 470 727 0 555 720 0 222 252 0 94 707 ...
output:
16 31 40 50 58 66 74 77 90 95 102 108 120 130 135 140 143 150 153 159 165 169 172 177 178 183 192 195 204 211 216 223 231 234 240 245 253 256 258 259 263 268 270 273 280 285 289 291 294 300 305 312 321 327 333 339 345 347 350 351 355 356 357 358 363 371 372 375 383 388 392 401 402 405 408 410 417 41...
result:
ok 200000 numbers
Test #23:
score: 0
Accepted
time: 28ms
memory: 13444kb
input:
1013 200000 693 980 0 492 853 0 62 353 0 192 231 0 540 925 0 295 474 0 62 924 0 2 221 0 189 490 0 260 634 0 35 322 0 56 102 0 119 795 0 705 899 0 88 336 0 221 306 0 296 674 0 506 618 0 24 738 0 15 61 0 465 917 0 211 344 0 347 842 0 62 712 0 237 300 0 808 935 0 553 935 0 492 933 0 170 779 0 531 774 0...
output:
19 34 48 58 72 83 89 96 105 114 125 135 137 141 145 147 156 165 169 172 182 187 192 196 203 212 214 217 224 231 237 243 244 97 248 252 257 262 265 270 275 280 282 289 293 300 309 313 321 325 329 333 340 345 351 355 358 364 365 369 371 377 381 386 388 392 395 400 403 407 410 411 413 417 421 427 433 4...
result:
ok 200000 numbers
Test #24:
score: 0
Accepted
time: 31ms
memory: 12732kb
input:
1491 200000 33 371 0 70 276 0 20 1390 0 50 1349 0 19 1408 0 268 1443 0 250 663 0 544 1290 0 1099 1486 0 932 1141 0 952 1484 0 157 604 0 422 922 0 560 1216 0 559 1280 0 229 699 0 42 1317 0 417 1161 0 162 366 0 793 1263 0 981 1009 0 627 718 0 701 1457 0 822 941 0 1121 1163 0 335 1379 0 162 320 0 329 1...
output:
20 33 35 47 58 69 81 94 101 113 123 133 139 148 157 163 173 182 189 194 202 212 221 230 237 242 247 255 259 264 274 279 285 286 288 296 306 315 322 326 333 336 339 345 351 357 359 365 371 378 386 390 392 399 408 413 203 417 424 429 435 439 446 455 461 468 472 474 478 485 494 502 506 514 519 522 524 ...
result:
ok 200000 numbers
Test #25:
score: 0
Accepted
time: 30ms
memory: 13180kb
input:
1746 200000 98 147 0 322 1294 0 479 1632 0 488 1184 0 1459 1633 0 758 1268 0 1284 1739 0 381 1091 0 387 1062 0 108 134 0 693 1720 0 1131 1549 0 494 654 0 316 359 0 138 1622 0 593 756 0 1544 1573 0 890 1247 0 1397 1406 0 963 1673 0 437 703 0 758 845 0 1157 1687 0 268 656 0 1501 1722 0 116 1720 0 1161...
output:
18 31 44 57 70 81 92 101 111 124 133 140 151 161 170 180 189 195 202 214 218 220 228 236 240 245 254 265 267 275 281 290 291 301 309 314 317 320 324 331 343 350 356 357 364 368 373 378 381 389 396 397 401 407 412 421 430 433 441 444 451 456 462 466 471 477 480 484 486 490 499 503 505 510 515 517 520...
result:
ok 200000 numbers
Test #26:
score: 0
Accepted
time: 35ms
memory: 12884kb
input:
4484 200000 2871 3455 0 3246 4301 0 1346 1445 0 3842 3949 0 1461 4213 0 3534 4470 0 345 1970 0 7 2243 0 292 691 0 115 1263 0 84 4197 0 1663 2622 0 1494 1672 0 45 3880 0 938 1386 0 1283 3959 0 22 960 0 226 1390 0 1992 2034 0 1347 2494 0 1779 4376 0 2584 3255 0 1326 1894 0 4000 4175 0 3170 4146 0 1234...
output:
12 31 44 55 66 76 83 91 104 107 116 127 134 143 152 164 175 182 190 198 206 213 225 234 241 246 256 267 276 286 294 306 313 320 325 331 339 347 356 360 365 375 383 388 393 405 413 419 423 431 437 452 460 461 467 471 481 484 492 498 504 511 516 524 525 535 542 548 555 565 576 581 590 596 601 610 614 ...
result:
ok 200000 numbers
Test #27:
score: 0
Accepted
time: 35ms
memory: 12672kb
input:
3505 200000 132 797 0 37 593 0 875 2614 0 547 2338 0 383 1509 0 1870 3365 0 2224 2920 0 342 977 0 895 3359 0 234 3459 0 1869 2867 0 925 2835 0 1646 1671 0 919 1961 0 132 1118 0 141 1766 0 476 3350 0 1768 1848 0 161 2280 0 2093 3052 0 2259 3082 0 1377 1878 0 1139 1884 0 1086 2523 0 481 702 0 260 1513...
output:
12 18 31 45 53 64 74 80 85 100 109 119 128 139 143 157 166 175 187 198 205 212 220 230 238 244 249 257 261 268 271 283 290 296 304 311 321 327 333 335 340 348 354 360 368 374 385 390 399 410 416 424 427 431 441 444 447 454 460 465 469 478 489 495 503 511 517 523 528 535 538 543 549 551 555 558 565 5...
result:
ok 200000 numbers
Test #28:
score: 0
Accepted
time: 32ms
memory: 12964kb
input:
9273 200000 3681 4432 0 7296 8903 0 163 5839 0 1694 6390 0 813 5633 0 7563 7965 0 1424 5003 0 2478 6503 0 6952 8435 0 3088 7829 0 2169 3377 0 378 6554 0 5756 8411 0 3415 9240 0 2311 5758 0 2827 6494 0 1821 7796 0 7808 8368 0 704 4551 0 7481 8157 0 2502 2650 0 1873 3775 0 7683 8453 0 6444 7736 0 1170...
output:
21 41 61 76 92 111 122 140 155 170 183 200 209 221 238 246 261 271 284 297 305 317 329 343 353 368 380 395 407 408 420 431 440 455 471 483 500 512 521 528 538 549 560 563 571 575 583 591 602 614 625 628 635 640 653 666 674 686 694 699 711 720 729 735 739 740 752 761 770 784 792 794 803 808 818 828 8...
result:
ok 200000 numbers
Test #29:
score: 0
Accepted
time: 28ms
memory: 14516kb
input:
7576 200000 6228 6331 0 1702 5506 0 1170 3906 0 1470 6904 0 5075 5919 0 88 5696 0 631 7242 0 2570 6454 0 4130 6084 0 2774 6947 0 33 3487 0 128 1170 0 2548 4599 0 1368 6509 0 5606 6768 0 238 7014 0 675 1099 0 3184 7555 0 3606 6156 0 1621 7102 0 1632 4545 0 1920 2768 0 4638 6214 0 5357 7253 0 40 268 0...
output:
23 34 50 67 88 107 122 138 150 163 179 186 196 205 221 232 236 250 264 277 282 290 303 312 319 330 345 353 364 365 379 390 404 415 430 443 452 466 478 489 500 508 516 526 535 547 558 569 578 589 600 609 620 628 638 647 655 660 669 682 690 699 700 706 718 730 738 739 750 762 769 779 786 792 804 810 8...
result:
ok 200000 numbers
Test #30:
score: 0
Accepted
time: 34ms
memory: 13432kb
input:
2229 200000 1099 1282 0 1809 2063 0 819 920 0 24 2169 0 798 957 0 301 488 0 565 1180 0 1465 1537 0 256 1853 0 207 694 0 1111 2223 0 1012 2200 0 486 1100 0 1125 2119 0 715 983 0 1211 1440 0 23 350 0 403 749 0 146 1107 0 713 933 0 463 2074 0 463 1031 0 8 666 0 217 262 0 301 709 0 160 1414 0 181 1987 0...
output:
15 35 49 62 76 87 98 108 114 126 141 147 153 160 173 184 195 205 214 219 227 233 242 250 251 262 269 278 288 296 304 314 324 330 338 339 342 346 350 356 366 370 378 389 394 401 406 417 421 429 436 447 449 451 457 465 470 474 481 490 496 499 504 509 514 517 519 525 526 531 540 548 555 560 565 570 577...
result:
ok 200000 numbers
Test #31:
score: 0
Accepted
time: 57ms
memory: 17176kb
input:
129912 200000 59993 75732 1 1526 94881 0 22100 118278 1 37282 53137 1 65700 96982 0 44860 77962 1 73410 121031 1 33770 38310 0 88363 108208 1 66893 82699 1 18720 25986 0 102736 105102 1 78184 85728 1 62304 109923 0 34286 86673 1 87992 100395 0 45752 115218 1 49763 76579 0 19511 129162 1 78180 80512 ...
output:
1 15 16 17 35 36 37 60 61 38 84 85 86 108 109 131 132 151 152 153 154 176 189 190 191 206 223 224 240 254 255 280 281 282 283 300 301 302 324 325 338 356 374 375 376 389 390 391 392 393 394 395 412 429 430 431 455 456 457 458 459 477 478 494 507 508 519 520 528 546 558 559 571 572 573 574 587 588 58...
result:
ok 200000 numbers
Test #32:
score: 0
Accepted
time: 41ms
memory: 13620kb
input:
32989 200000 13162 14350 0 1363 10305 0 10130 27572 0 12892 30917 0 5390 18298 0 17575 24879 0 9295 31837 0 17978 23499 0 6781 27333 0 8157 8862 0 10770 14564 0 8639 17704 0 10984 20297 0 18813 21598 0 6413 17847 0 7412 19771 0 9274 23095 0 1706 5402 0 19004 31618 0 26952 30215 0 18116 26019 0 9846 ...
output:
20 34 57 74 95 111 129 141 156 170 187 205 218 232 242 258 270 280 296 312 324 332 343 352 366 377 387 401 413 424 432 452 463 469 477 491 498 500 510 520 532 549 558 570 573 582 589 604 611 620 625 634 641 651 656 663 672 677 691 709 725 732 744 751 769 777 796 806 813 822 826 837 846 861 869 878 8...
result:
ok 200000 numbers
Test #33:
score: 0
Accepted
time: 36ms
memory: 13280kb
input:
21725 200000 6908 20229 0 5339 7667 0 954 19973 0 4539 12282 0 7254 16916 0 8910 20940 0 17637 21358 0 4886 5910 0 1204 4120 0 10958 21565 0 783 6995 0 2348 2829 0 1382 19317 0 10635 13715 0 11859 15475 0 16435 17752 0 7207 8316 0 2038 11199 0 14660 19132 0 6253 19114 0 9533 15935 0 623 5103 0 19 17...
output:
23 44 65 81 95 115 130 151 171 185 204 223 239 258 274 289 304 320 338 353 370 386 401 413 431 432 433 444 459 470 489 499 517 533 546 555 569 583 599 609 624 637 646 656 657 669 678 689 697 708 709 710 718 719 734 735 748 765 782 791 800 801 811 812 813 823 839 847 861 869 880 881 888 898 908 924 9...
result:
ok 200000 numbers
Test #34:
score: 0
Accepted
time: 54ms
memory: 16748kb
input:
104039 200000 31007 67357 1 4201 28237 1 29803 67291 1 7692 74344 1 9579 50083 0 25308 51925 1 4280 38762 0 24956 49415 0 51657 64190 1 18115 59523 1 14062 101212 1 280 26709 1 25186 76464 1 2265 63556 0 44031 74180 0 8793 13299 1 22295 44656 0 27479 75272 0 33525 90026 1 8287 41414 1 9108 66829 0 4...
output:
1 2 3 4 35 36 65 92 93 94 95 96 97 124 148 149 176 199 200 201 223 244 266 285 306 328 329 342 343 344 345 366 385 386 407 425 426 427 428 452 453 468 469 470 487 488 489 490 506 507 508 527 548 569 570 571 586 599 600 601 602 603 620 621 637 650 662 682 701 716 735 749 765 766 767 786 806 822 823 8...
result:
ok 200000 numbers
Test #35:
score: 0
Accepted
time: 54ms
memory: 17496kb
input:
126690 200000 17984 93729 0 79078 117089 1 60960 111934 1 107524 123199 1 78066 94846 1 6446 61655 0 33973 121876 1 90303 109804 1 71829 115859 1 57096 101171 0 65084 88863 0 26187 99948 1 51285 122610 1 20404 70163 1 1965 70931 0 34074 77170 1 78297 105065 1 12250 112297 1 34695 96671 0 66384 68567...
output:
27 28 29 30 31 60 61 62 63 86 112 113 114 115 136 137 138 139 159 160 161 176 177 178 199 228 229 244 245 246 247 248 249 250 267 282 283 284 306 307 308 309 329 352 353 378 379 380 381 382 383 384 385 386 387 388 389 390 391 410 411 412 413 414 434 435 436 460 461 476 499 500 501 502 503 504 505 52...
result:
ok 200000 numbers
Test #36:
score: 0
Accepted
time: 60ms
memory: 19900kb
input:
200000 200000 134692 199609 1 73530 164439 1 19151 178006 1 49037 167556 1 46412 193515 1 40938 83758 1 62131 187982 1 23168 156326 1 52795 147844 1 65198 150846 1 181167 199966 1 49504 98645 1 57629 187624 1 114257 191123 1 28453 191804 1 52918 142432 1 96 104448 1 37889 67556 1 4527 136085 1 59684...
output:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...
result:
ok 200000 numbers
Test #37:
score: 0
Accepted
time: 56ms
memory: 20792kb
input:
200000 200000 17938 59368 1 143328 161398 1 418 17054 1 39923 158732 1 49997 68681 1 19874 85008 1 124699 131787 1 51417 61178 1 14536 160824 1 58959 104562 1 40716 189018 1 16269 178220 1 114125 158732 1 75160 143489 1 13269 34610 1 150436 199414 1 82563 140001 1 10957 144631 1 121309 149297 1 1076...
output:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...
result:
ok 200000 numbers
Test #38:
score: 0
Accepted
time: 58ms
memory: 20992kb
input:
200000 200000 76988 78193 1 3620 190751 1 43253 112411 1 95628 169849 1 67541 88620 1 3248 27880 1 96768 134059 1 90986 93936 1 111998 184724 1 100034 164880 1 12882 171147 1 94310 153204 1 106993 170098 1 135499 198504 1 45405 106391 1 35151 51827 1 35745 158408 1 87031 159768 1 49852 53440 1 10872...
output:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 ...
result:
ok 200000 numbers
Test #39:
score: 0
Accepted
time: 0ms
memory: 9776kb
input:
2 1 1 2 1
output:
1
result:
ok 1 number(s): "1"
Test #40:
score: 0
Accepted
time: 1ms
memory: 9776kb
input:
3 2 2 3 1 1 2 1
output:
1 2
result:
ok 2 number(s): "1 2"
Test #41:
score: 0
Accepted
time: 1ms
memory: 12016kb
input:
3 3 1 3 1 2 3 0 1 2 1
output:
1 3 2
result:
ok 3 number(s): "1 3 2"