Code Submission Evaluation System Login

# NOI 2019 Open

 Start: N/A End: N/A

CSES - NOI 2019 Open - Results
History
0:12:467
 Task: Graph Ordering Sender: pwild Submission time: 2019-03-09 22:17:00 Language: C++ Status: READY Score: 7

## Feedback

 group verdict score #1 ACCEPTED 7 #2 WRONG ANSWER 0 #3 WRONG ANSWER 0 #4 WRONG ANSWER 0 #5 WRONG ANSWER 0

## Code

```#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef pair<ll,ll> pll;
typedef vector<bool> vb;
const ll oo = 0x3f3f3f3f3f3f3f3f;
const double eps = 1e-9;
#define sz(c) ll((c).size())
#define all(c) begin(c), end(c)
#define FOR(i,a,b) for (ll i = (a); i < (b); i++)
#define FORD(i,a,b) for (ll i = (b)-1; i >= (a); i--)
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define eb emplace_back
#define xx first
#define yy second
#define has(c,i) ((c).find(i) != end(c))
#define TR(X) ({ if(1) cerr << "TR: " << (#X) << " = " << (X) << endl; })

vl solve1(vvl adj) { // the graph is a tree
ll n = sz(adj);

FOR(i,0,n) if (sz(adj[i]) > 2) return {};

ll cur = -1;
FOR(i,0,n) if (sz(adj[i]) == 1) cur = i;
assert(cur != -1);

ll prv = cur;
vl res = {prv,cur};

while (sz(res) < n) {
ll nxt = adj[cur][0] ^ adj[cur][1] ^ prv;
prv = cur, cur = nxt;
res.pb(cur);
}
return res;
}

int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);

ll n, m;
cin >> n >> m;

FOR(i,0,m) {
ll a, b;
cin >> a >> b;
a--, b--;
}

vl res;
if (m == n-1) {
}

if (sz(res)) {
for (ll x: res) cout << x+1 << " ";
cout << endl;
} else {
cout << "IMPOSSIBLE" << endl;
}
}

```

## Test details

### Test 1

Group: 1, 4, 5

Verdict: ACCEPTED

input
```100000 99999 8326 74462 11810 58064 21677 73087 62986 25005 44015 67285 25748 90380 1641 9064 90508 40199 30027 53848 70515 82445 82921 44089 75510 6255 69490 96800 9011 92223 64993 79106 96512 55490 73047 42211 3518 46598 28335 51173 ...```
view   save

correct output
`1 44159 25721 84659 90058 9960...`
view   save

user output
`100000 55408 4224 23528 55621 ...`
view   save

### Test 2

Group: 1, 5

Verdict: ACCEPTED

input
```100000 99999 28990 31200 86271 56882 61089 18658 52422 57504 41836 52936 8208 22795 59684 75956 79383 71457 24739 60373 33383 75238 92689 57624 30287 59926 12870 39217 55276 64411 361 81949 99800 66622 1446 24476 10529 26186 30002 49316 ...```
view   save

correct output
`68068 86325 91398 75677 51068 ...`
view   save

user output
`75520 37121 89333 44052 51784 ...`
view   save

### Test 3

Group: 1, 5

Verdict: ACCEPTED

input
```100000 99999 29378 80094 12282 29378 96138 29378 61870 29378 67909 29378 29378 80536 63476 29378 56772 29378 69109 29378 29378 49823 97096 29378 62718 29378 36931 29378 52187 29378 31043 29378 3550 29378 76671 29378 59350 29378 29378 35354 ...```
view   save

correct output
`IMPOSSIBLE`
view   save

user output
`IMPOSSIBLE`
view   save

### Test 4

Group: 1, 5

Verdict: ACCEPTED

input
```100000 99999 97935 71091 9181 31715 73649 47675 45394 25464 76221 70395 43987 4136 90374 28244 24781 3403 85118 55279 31563 85690 23597 68684 38247 47316 69594 12835 79560 8517 50177 44760 28625 44762 41995 30716 44626 74796 26328 90967 ...```
view   save

correct output
`IMPOSSIBLE`
view   save

user output
`IMPOSSIBLE`
view   save

### Test 5

Group: 1, 5

Verdict: ACCEPTED

input
```100000 99999 2897 55594 11759 89041 56061 8717 69672 73046 14405 88587 67734 84784 60155 71223 18142 10296 56334 31721 28181 89316 41982 55775 44161 21326 94593 67116 74052 12560 95413 61624 98619 52858 84963 93831 14854 3135 68429 91716 ...```
view   save

correct output
`IMPOSSIBLE`
view   save

user output
`IMPOSSIBLE`
view   save

### Test 6

Group: 2, 3, 5

Verdict: ACCEPTED

input
```100 200 55 10 33 57 68 39 29 27 57 75 95 15 2 35 28 40 34 91 77 27 38 56 86 62 47 52 14 86 52 15 14 55 7 71 20 98 85 74 ...```
view   save

correct output
`IMPOSSIBLE`
view   save

user output
`IMPOSSIBLE`
view   save

### Test 7

Group: 2, 3, 5

Verdict: ACCEPTED

input
```100 175 71 86 100 88 83 92 25 73 12 44 29 10 5 42 99 20 82 12 32 7 64 6 47 40 11 49 34 59 89 91 33 3 8 6 14 30 95 16 ...```
view   save

correct output
`IMPOSSIBLE`
view   save

user output
`IMPOSSIBLE`
view   save

### Test 8

Group: 2, 3, 4, 5

input
```100 200 26 58 49 25 66 20 20 85 38 56 73 41 13 38 58 81 1 32 48 81 17 67 47 24 82 81 77 52 51 73 57 90 39 90 26 32 26 12 ...```
view   save

correct output
`1 2 86 60 34 92 23 4 44 89 76 ...`
view   save

user output
`IMPOSSIBLE`
view   save

### Test 9

Group: 2, 3, 4, 5

input
```100 195 19 28 63 48 1 57 1 20 99 70 49 65 60 5 78 50 23 79 43 4 32 60 57 53 45 88 38 63 1 11 21 73 85 15 60 71 59 80 ...```
view   save

correct output
`12 97 18 74 36 10 78 50 61 95 ...`
view   save

user output
`IMPOSSIBLE`
view   save

### Test 10

Group: 2, 3, 4, 5

input
```100 193 48 66 15 67 32 14 36 78 91 82 62 43 67 32 64 99 97 77 70 89 35 71 45 3 6 54 100 6 32 13 82 61 12 1 40 32 37 19 ...```
view   save

correct output
`1 56 13 32 14 49 75 93 18 6 54...`
view   save

user output
`IMPOSSIBLE`
view   save

### Test 11

Group: 2, 3, 5

input
```100 195 47 68 57 61 45 17 80 61 73 6 29 42 81 88 23 19 10 2 40 65 41 83 20 83 39 26 22 61 71 7 80 9 92 61 11 95 74 47 ...```
view   save

correct output
`57 20 83 41 25 33 60 91 59 7 7...`
view   save

user output
`IMPOSSIBLE`
view   save

### Test 12

Group: 2, 3, 5

input
```100 185 43 78 76 99 78 39 83 61 39 48 69 90 29 3 8 33 18 100 74 14 94 34 13 62 64 81 77 69 13 1 95 84 38 67 74 52 1 5 ...```
view   save

correct output
`78 43 32 88 26 28 64 81 7 72 2...`
view   save

user output
`IMPOSSIBLE`
view   save

### Test 13

Group: 2, 3, 4, 5

input
```99 132 96 16 18 89 98 50 66 26 90 36 61 39 20 27 88 49 10 31 21 19 28 37 63 78 48 57 59 94 75 30 86 63 86 80 72 11 24 53 ...```
view   save

correct output
`1 12 45 71 97 22 35 9 60 27 20...`
view   save

user output
`IMPOSSIBLE`
view   save

### Test 14

Group: 2, 3, 4, 5

input
```98 144 25 6 30 34 58 25 31 41 95 26 85 91 74 56 51 89 81 17 69 84 74 75 92 32 70 78 82 93 93 55 3 6 54 73 6 16 19 96 ...```
view   save

correct output
`32 7 92 1 63 86 87 14 90 17 81...`
view   save

user output
`IMPOSSIBLE`
view   save

### Test 15

Group: 2, 3, 4, 5

input
```96 145 19 70 72 92 27 72 17 85 38 88 12 45 62 95 53 78 49 54 4 50 46 2 1 50 8 14 75 67 25 93 81 95 77 12 61 86 8 84 ...```
view   save

correct output
`1 50 30 4 10 48 42 5 70 19 29 ...`
view   save

user output
`IMPOSSIBLE`
view   save

### Test 16

Group: 2, 3, 4, 5

input
```96 158 79 74 41 70 8 5 73 90 77 34 43 94 10 6 89 85 17 61 21 35 81 91 78 25 80 28 64 34 25 70 58 90 53 96 52 15 63 71 ...```
view   save

correct output
`7 59 44 27 1 30 49 28 80 52 15...`
view   save

user output
`IMPOSSIBLE`
view   save

### Test 17

Group: 2, 3, 4, 5

input
```96 142 95 35 67 89 91 70 48 21 6 17 32 74 87 7 7 72 12 94 28 54 44 84 76 56 64 77 13 51 25 78 57 88 94 47 19 69 61 96 ...```
view   save

correct output
`13 20 81 33 1 51 19 69 16 85 6...`
view   save

user output
`IMPOSSIBLE`
view   save

### Test 18

Group: 2, 3, 4, 5

input
```72 111 70 17 25 3 58 24 52 9 64 44 60 56 53 41 30 17 16 33 47 68 2 21 61 26 27 66 25 27 27 12 7 23 45 34 36 71 6 72 ...```
view   save

correct output
`21 59 48 8 1 2 31 10 11 41 4 5...`
view   save

user output
`IMPOSSIBLE`
view   save

### Test 19

Group: 3, 4, 5

input
```988 1563 402 701 830 801 50 578 8 144 680 946 664 707 921 238 668 123 652 742 67 868 894 232 42 764 323 264 144 495 710 662 407 187 884 477 361 671 532 76 ...```
view   save

correct output
`1 136 368 683 447 304 131 53 8...`
view   save

user output
`IMPOSSIBLE`
view   save

### Test 20

Group: 3, 4, 5

input
```994 1555 171 541 66 915 330 350 494 251 264 747 575 968 55 37 877 232 720 409 338 560 560 241 57 941 155 637 744 175 666 896 316 449 411 982 148 210 560 617 ...```
view   save

correct output
`1 164 205 151 951 797 4 654 14...`
view   save

user output
`IMPOSSIBLE`
view   save

### Test 21

Group: 3, 4, 5

input
```1000 2000 711 947 775 441 691 471 844 28 508 668 448 986 32 745 951 271 633 472 547 275 146 775 886 678 256 868 744 802 772 226 479 136 636 313 357 794 954 627 ...```
view   save

correct output
`1 676 731 662 248 31 165 558 8...`
view   save

user output
`IMPOSSIBLE`
view   save

### Test 22

Group: 3, 4, 5

input
```1000 2000 811 889 873 984 83 52 144 511 492 683 22 816 812 932 737 985 473 873 806 525 228 171 770 989 66 47 706 669 755 788 584 292 920 385 739 231 82 497 ...```
view   save

correct output
`60 909 522 568 40 77 181 441 8...`
view   save

user output
`IMPOSSIBLE`
view   save

### Test 23

Group: 3, 5

input
```1000 1869 625 715 448 714 110 927 432 1000 377 622 556 27 889 330 592 241 646 648 491 934 25 973 320 947 573 284 547 601 863 484 175 71 194 864 948 287 57 122 ...```
view   save

correct output
`224 326 221 30 76 475 666 694 ...`
view   save

user output
`IMPOSSIBLE`
view   save

### Test 24

Group: 3, 5

input
```1000 1783 709 1 182 768 355 40 786 260 413 352 313 610 860 643 604 138 381 448 768 655 896 355 266 578 351 352 368 754 371 621 364 709 136 396 564 718 804 832 ...```
view   save

correct output
`230 6 135 678 346 19 470 960 3...`
view   save

user output
`IMPOSSIBLE`
view   save

### Test 25

Group: 3, 5

Verdict: ACCEPTED

input
```1000 2000 92 876 273 598 287 535 526 972 127 349 465 798 952 978 150 296 258 915 348 116 300 596 14 651 884 39 809 741 369 926 344 399 605 704 675 772 563 465 ...```
view   save

correct output
`IMPOSSIBLE`
view   save

user output
`IMPOSSIBLE`
view   save

### Test 26

Group: 3, 5

Verdict: ACCEPTED

input
```1000 1910 789 821 553 740 889 527 488 730 56 649 463 394 783 275 9 395 624 652 943 787 229 285 840 573 997 817 144 983 692 518 493 570 830 791 813 425 544 462 ...```
view   save

correct output
`IMPOSSIBLE`
view   save

user output
`IMPOSSIBLE`
view   save

### Test 27

Group: 3, 5

input
```1000 1608 910 416 503 898 928 14 412 903 368 715 189 650 585 800 303 613 728 749 277 746 211 223 394 100 375 288 645 554 160 139 71 680 270 73 456 595 160 634 ...```
view   save

correct output
`140 404 739 563 63 794 623 948...`
view   save

user output
`IMPOSSIBLE`
view   save

### Test 28

Group: 5

input
```100000 198666 5659 89691 91040 53375 96642 56177 28768 57001 90067 81267 62029 49131 5887 25578 82020 20202 32531 92466 79772 67741 21868 90077 8371 22131 51338 34183 25403 27370 69778 13419 56371 48822 21490 22070 89622 72035 65308 18025 ...```
view   save

correct output
`45598 74078 1039 83702 16344 8...`
view   save

user output
`IMPOSSIBLE`
view   save

### Test 29

Group: 5

input
```100000 197194 41636 91770 63018 23827 39207 93713 67765 47715 42503 98525 22806 33345 9252 16682 55282 15992 26607 84326 21571 40621 48028 43568 61494 19271 12533 42341 69745 6589 33532 83609 91910 77609 63588 91967 65003 52575 75276 47265 ...```
view   save

correct output
`79054 61855 53279 55546 60860 ...`
view   save

user output
`IMPOSSIBLE`
view   save

### Test 30

Group: 4, 5

input
```100000 199985 13674 42886 51349 6858 78502 18751 13628 65936 94583 55798 35735 73848 14327 51280 25069 7867 18638 73016 89449 5658 10827 73379 83883 36636 6544 63142 70489 8791 19081 16071 98184 96625 79178 9152 4062 64756 10971 80397 ...```
view   save

correct output
`17857 81664 4369 61462 79754 8...`
view   save

user output
`IMPOSSIBLE`
view   save

### Test 31

Group: 4, 5

input
```100000 200000 27666 33166 7161 81452 73134 30281 5106 29308 74024 54979 27809 38563 97584 16831 79439 24435 10115 92306 80905 53723 81479 64270 98141 45954 56344 8550 92858 43047 3395 3222 59447 34956 69188 39844 42795 17077 70880 50583 ...```
view   save

correct output
`76869 5635 23236 12666 61633 8...`
view   save

user output
`IMPOSSIBLE`
view   save

### Test 32

Group: 4, 5

input
```100000 200000 62814 54729 98407 26888 91808 70132 58916 49730 73869 34718 487 9203 55604 97398 26259 47917 7854 7396 36241 59883 73276 84396 32608 30448 19012 67146 4297 14695 73453 46162 73390 89718 98363 10973 78431 44885 7939 71374 ...```
view   save

correct output
`19788 11202 3496 24237 68564 5...`
view   save

user output
`IMPOSSIBLE`
view   save

### Test 33

Group: 4, 5

input
```100000 200000 2299 91653 21125 75544 54029 94067 86513 45051 84103 89728 11101 34120 7142 38289 22106 72869 70109 66745 37382 88008 19849 50285 74580 34127 80572 83219 56727 45071 60816 46202 73887 82880 41230 49035 27252 33575 41247 22878 ...```
view   save

correct output
`1 20339 9304 40427 67694 95656...`
view   save

user output
`IMPOSSIBLE`
view   save

### Test 34

Group: 5

Verdict: ACCEPTED

input
```100000 200000 34688 93668 78127 18902 55150 33116 273 88797 54162 6894 29783 47638 50803 43508 96000 36847 47192 18023 73248 21062 7620 87746 91369 35512 29495 34710 75551 7503 37555 81576 49533 29151 84023 71453 93666 50720 57148 13527 ...```
view   save

correct output
`IMPOSSIBLE`
view   save

user output
`IMPOSSIBLE`
view   save

### Test 35

Group: 5

Verdict: ACCEPTED

input
```100000 200000 21026 14630 5605 59639 25604 78683 55713 70513 13496 86363 86370 30333 3766 8189 21644 10843 53376 47273 66488 90280 11863 40341 75268 71444 97707 36277 43240 54738 36650 75368 45258 98837 35312 36241 41662 38752 14220 25578 ...```
view   save

correct output
`IMPOSSIBLE`
view   save

user output
`IMPOSSIBLE`
view   save

### Test 36

Group: 5

Verdict: ACCEPTED

input
```100000 200000 63190 73606 52072 54105 22092 31495 9189 37924 88899 39598 45972 62303 50785 91382 16970 8957 37484 39517 66773 90437 61491 47370 81345 47382 86086 81005 649 78507 30382 42526 81865 36163 46224 13802 96108 96030 7637 88589 ...```
view   save

correct output
`IMPOSSIBLE`
view   save

user output
`IMPOSSIBLE`
view   save

### Test 37

Group: 1, 2, 3, 4, 5

Verdict: ACCEPTED

input
```2 1 2 1```
view   save

correct output
`1 2`
view   save

user output
`2 1`
view   save

### Test 38

Group: 2, 3, 5

Verdict: ACCEPTED

input
```7 9 1 2 1 3 2 3 1 4 1 5 4 5 1 6 1 7 6 7```
view   save

correct output
`IMPOSSIBLE`
view   save

user output
`IMPOSSIBLE`
view   save

### Test 39

Group: 2, 3, 5

Verdict: ACCEPTED

input
```9 12 1 2 2 3 3 1 4 5 5 6 6 4 7 8 8 9 9 7 1 4 4 7 7 1```
view   save

correct output
`IMPOSSIBLE`
view   save

user output
`IMPOSSIBLE`
view   save

### Test 40

Group: 2, 3, 5

input
```5 5 4 2 4 3 2 1 3 1 1 5```
view   save

correct output
`4 2 3 1 5`
view   save

user output
`IMPOSSIBLE`
view   save

### Test 41

Group: 1, 2, 3, 5

Verdict: ACCEPTED

input
```4 3 1 2 3 2 4 2```
view   save

correct output
`IMPOSSIBLE`
view   save

user output
`IMPOSSIBLE`
view   save

### Test 42

Group: 2, 3, 5

input
```17 30 4 1 3 14 6 16 13 6 7 1 1 15 15 11 8 11 3 13 12 16 9 3 17 12 16 9 2 5 5 10 10 17 7 8 1 6 12 14 ...```
view   save

correct output
`7 8 11 15 1 2 9 3 14 13 5 10 1...`
view   save

user output
`IMPOSSIBLE`
view   save

### Test 43

Group: 3, 4, 5

input
```992 1712 377 709 847 640 261 902 761 693 831 695 656 849 372 411 867 655 189 812 303 413 304 381 60 299 37 399 48 202 447 769 915 767 920 458 661 452 522 719 ...```
view   save

correct output
`870 1 925 928 950 257 766 520 ...`
view   save

user output
`IMPOSSIBLE`
view   save

### Test 44

Group: 3, 4, 5

input
```990 1672 305 445 800 155 365 779 824 247 311 819 403 755 768 387 333 836 147 307 352 602 569 857 531 341 880 37 273 27 762 566 778 550 766 758 435 968 692 450 ...```
view   save

correct output
`108 461 160 696 895 655 376 21...`
view   save

user output
`IMPOSSIBLE`
view   save

### Test 45

Group: 2, 3, 4, 5

input
```99 169 35 32 97 43 22 62 33 7 48 7 62 70 28 30 40 51 72 65 14 25 5 48 58 24 97 39 98 76 34 56 92 18 19 1 12 24 53 98 ...```
view   save

correct output
`19 70 62 22 54 78 25 14 3 81 1...`
view   save

user output
`IMPOSSIBLE`
view   save

### Test 46

Group: 2, 3, 4, 5

input
```99 164 62 73 19 35 55 92 79 91 22 57 48 39 27 79 97 19 9 53 49 65 43 6 55 59 43 63 52 80 21 81 55 87 46 60 13 98 70 89 ...```
view   save

correct output
`21 25 64 90 17 15 89 95 70 33 ...`
view   save

user output
`IMPOSSIBLE`
view   save

### Test 47

Group: 2, 3, 5

input
```53 68 7 46 51 14 3 18 8 40 2 34 32 24 39 41 8 12 7 44 33 27 50 28 51 13 43 52 5 49 14 17 33 25 24 49 42 10 8 22 ...```
view   save

correct output
`32 30 38 33 27 12 8 20 2 34 45...`
view   save

user output
`IMPOSSIBLE`
view   save

### Test 48

Group: 3, 4, 5

input
```996 1902 661 201 19 613 895 438 180 32 282 870 807 748 354 310 885 290 464 793 418 992 106 13 755 578 791 296 902 392 897 390 10 82 861 59 848 838 670 308 ...```
view   save

correct output
`220 795 198 239 40 164 773 834...`
view   save

user output
`IMPOSSIBLE`
view   save

### Test 49

Group: 4, 5

```6110 11528 3366 4718 3226 2188 5022 1186 3205 5349 1695 3772 5366 3274 1997 3580 4444 5585 5779 460 3335 3718 261 3205 622 418 1251 410 5248 4595 4608 5008 2946 3413 2276 3609 1577 5076 2569 4359 ...```
`1 2527 2211 554 4201 4522 1494...`
`IMPOSSIBLE`