Task: | HDRF |
Sender: | ankka22 |
Submission time: | 2017-03-09 15:03:39 +0200 |
Language: | C++ |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | WRONG ANSWER | 0 |
test | verdict | time | |
---|---|---|---|
#1 | WRONG ANSWER | 0.07 s | details |
#2 | WRONG ANSWER | 0.08 s | details |
#3 | WRONG ANSWER | 0.06 s | details |
#4 | WRONG ANSWER | 0.08 s | details |
#5 | WRONG ANSWER | 0.08 s | details |
#6 | WRONG ANSWER | 0.08 s | details |
#7 | WRONG ANSWER | 0.07 s | details |
#8 | WRONG ANSWER | 0.08 s | details |
#9 | WRONG ANSWER | 0.07 s | details |
#10 | WRONG ANSWER | 0.06 s | details |
#11 | WRONG ANSWER | 0.07 s | details |
#12 | WRONG ANSWER | 0.07 s | details |
#13 | WRONG ANSWER | 0.07 s | details |
#14 | WRONG ANSWER | 0.07 s | details |
#15 | WRONG ANSWER | 0.06 s | details |
#16 | WRONG ANSWER | 0.07 s | details |
#17 | WRONG ANSWER | 0.06 s | details |
#18 | WRONG ANSWER | 0.11 s | details |
#19 | WRONG ANSWER | 0.07 s | details |
#20 | WRONG ANSWER | 0.07 s | details |
#21 | WRONG ANSWER | 0.08 s | details |
#22 | WRONG ANSWER | 0.07 s | details |
#23 | WRONG ANSWER | 0.08 s | details |
#24 | WRONG ANSWER | 0.08 s | details |
#25 | WRONG ANSWER | 0.07 s | details |
#26 | WRONG ANSWER | 0.08 s | details |
#27 | WRONG ANSWER | 0.08 s | details |
#28 | WRONG ANSWER | 0.07 s | details |
#29 | WRONG ANSWER | 0.06 s | details |
#30 | WRONG ANSWER | 0.08 s | details |
#31 | WRONG ANSWER | 0.06 s | details |
#32 | WRONG ANSWER | 0.06 s | details |
#33 | WRONG ANSWER | 0.07 s | details |
#34 | WRONG ANSWER | 0.09 s | details |
#35 | WRONG ANSWER | 0.07 s | details |
#36 | WRONG ANSWER | 0.09 s | details |
#37 | WRONG ANSWER | 0.08 s | details |
#38 | WRONG ANSWER | 0.10 s | details |
#39 | WRONG ANSWER | 0.07 s | details |
#40 | WRONG ANSWER | 0.10 s | details |
#41 | WRONG ANSWER | 0.08 s | details |
#42 | WRONG ANSWER | 0.07 s | details |
#43 | WRONG ANSWER | 0.07 s | details |
#44 | WRONG ANSWER | 0.06 s | details |
#45 | WRONG ANSWER | 0.07 s | details |
#46 | WRONG ANSWER | 0.07 s | details |
#47 | WRONG ANSWER | 0.07 s | details |
#48 | WRONG ANSWER | 0.11 s | details |
#49 | WRONG ANSWER | 0.08 s | details |
#50 | WRONG ANSWER | 0.08 s | details |
#51 | WRONG ANSWER | 0.07 s | details |
#52 | WRONG ANSWER | 0.07 s | details |
#53 | TIME LIMIT EXCEEDED | -- | details |
#54 | TIME LIMIT EXCEEDED | -- | details |
#55 | TIME LIMIT EXCEEDED | -- | details |
#56 | TIME LIMIT EXCEEDED | -- | details |
#57 | TIME LIMIT EXCEEDED | -- | details |
#58 | TIME LIMIT EXCEEDED | -- | details |
#59 | TIME LIMIT EXCEEDED | -- | details |
#60 | TIME LIMIT EXCEEDED | -- | details |
#61 | TIME LIMIT EXCEEDED | -- | details |
#62 | WRONG ANSWER | 0.08 s | details |
#63 | WRONG ANSWER | 0.08 s | details |
Code
#include <iostream> #include <algorithm> #include <vector> #include <unordered_set> #include <bitset> using namespace std; #define F first #define S second int n, m, x, y, count, a[101010]; unordered_set<int> se[101010]; pair<int, int> kohtali[202020]; int counter = 0; vector<int> va[201010], oi[201010], kaet; int main() { cin >> n >> m; for (int i = 0; i < m; i++) { cin >> y >> x; kohtali[y].F = x; kohtali[y].S = x+1; kaet.push_back(y); oi[x].push_back(y); va[x+1].push_back(y); } for (int i = 1; i <= n; i++) { sort(oi[i].begin(), oi[i].end()); sort(va[i].begin(), va[i].end()); sort(kaet.begin(), kaet.end()); } /* for (int i = 1; i <= n; i++) { cout << "linjan " << i << " vasemmalla: " << endl; for (auto u: va[i]) { cout << u << endl; } cout << "linjan " << i << " oikealla: " << endl; for (auto u: oi[i]) { cout << u << endl; } } cout << "käet kohdittain yyn mukaan" << endl; for (auto u: kaet) { cout << "kohdan " << u << " käsi vaikuttaa linjoille: " << endl; cout << kohtali[u].F << " " << kohtali[u].S << endl; } for (int i = 1; i <= n; i++) { moi(0, i, i); } for (int i = 1; i <= n; i++) { //cout << "linjalle " << i << " tulee linjoilta: " << endl; //for (auto u: se[i]) { // cout << u << endl; //} cout << se[i].size() << " "; }*/ for (int i = 1; i <= n; i++) { se[i].insert(i); //bs[i].set(i, 1); }/* for (int i = 1; i<= n; i++) { cout << endl; for (int ii = 1; ii <= n; ii++) cout << bs[i][ii]; } cout << endl; bs[1] |= bs[2];*/ for (auto u: kaet) { if (se[kohtali[u].F].size() < se[kohtali[u].S].size()) { for (auto U: se[kohtali[u].F]) { se[kohtali[u].S].insert(U); } se[kohtali[u].F] = se[kohtali[u].S]; } else { for (auto U: se[kohtali[u].S]) { se[kohtali[u].F].insert(U); } se[kohtali[u].S] = se[kohtali[u].F]; } //se[kohtali[u].F].insert(se[kohtali[u].S].begin(), se[kohtali[u].S].end()); //se[kohtali[u].S] = se[kohtali[u].F]; //bs[kohtali[u].F] |= bs[kohtali[u].S]; //bs[kohtali[u].S] = bs[kohtali[u].F]; } for (int i = 1; i<= n; i++) { cout << se[i].size() << " "; } cout << '\n'; } /* 5 8 1000 1 2000 3 3000 1 4000 2 1500 1 1600 1 500 4 3500 4 */
Test details
Test 1
Verdict: WRONG ANSWER
input |
---|
2 1 1 2 |
correct output |
---|
2 1 |
user output |
---|
1 1 |
Test 2
Verdict: WRONG ANSWER
input |
---|
100 85 42 34 7 48 48 63 90 37 80 2... |
correct output |
---|
95 2 85 65 59 8 36 24 82 71 61... |
user output |
---|
2 2 1 2 2 1 1 1 1 3 3 2 2 2 2 ... |
Test 3
Verdict: WRONG ANSWER
input |
---|
100 14 35 99 80 25 28 11 70 24 51 ... |
correct output |
---|
72 77 43 9 93 49 70 13 69 66 7... |
user output |
---|
1 1 1 1 2 2 1 1 1 1 2 2 1 1 1 ... |
Test 4
Verdict: WRONG ANSWER
input |
---|
100 60 55 18 87 58 26 35 17 48 9 8... |
correct output |
---|
89 77 39 93 49 64 56 38 74 80 ... |
user output |
---|
2 2 1 2 2 1 1 1 1 1 1 1 1 2 2 ... |
Test 5
Verdict: WRONG ANSWER
input |
---|
100 57 68 23 81 85 54 62 73 100 10... |
correct output |
---|
10 11 100 40 58 86 67 28 26 51... |
user output |
---|
1 1 1 1 4 4 3 3 3 1 1 1 2 2 2 ... |
Test 6
Verdict: WRONG ANSWER
input |
---|
100 33 22 18 33 26 31 57 23 93 97 ... |
correct output |
---|
60 100 4 10 76 50 71 94 17 20 ... |
user output |
---|
1 2 2 1 2 2 1 2 2 1 2 2 1 1 1 ... |
Test 7
Verdict: WRONG ANSWER
input |
---|
200 87 30 52 56 164 149 193 82 188... |
correct output |
---|
191 178 85 36 55 35 43 3 30 97... |
user output |
---|
1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 ... |
Test 8
Verdict: WRONG ANSWER
input |
---|
200 3 59 148 66 188 81 172 152 170... |
correct output |
---|
115 121 107 74 151 91 80 118 2... |
user output |
---|
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ... |
Test 9
Verdict: WRONG ANSWER
input |
---|
5 4 4 1 1 3 5 2 1 4 |
correct output |
---|
3 2 4 5 1 |
user output |
---|
2 3 3 2 2 |
Test 10
Verdict: WRONG ANSWER
input |
---|
200 158 82 152 26 46 191 100 180 2... |
correct output |
---|
13 181 18 163 24 130 2 158 184... |
user output |
---|
1 2 2 2 2 3 3 2 1 2 2 4 4 4 4 ... |
Test 11
Verdict: WRONG ANSWER
input |
---|
200 197 134 27 109 102 77 30 71 14... |
correct output |
---|
112 144 12 131 64 137 175 117 ... |
user output |
---|
3 3 4 4 3 4 5 5 1 3 3 3 3 3 3 ... |
Test 12
Verdict: WRONG ANSWER
input |
---|
200 101 78 128 55 9 78 35 87 56 6 ... |
correct output |
---|
197 138 177 126 68 147 145 73 ... |
user output |
---|
1 1 1 1 1 1 1 3 3 2 2 2 1 1 2 ... |
Test 13
Verdict: WRONG ANSWER
input |
---|
300 259 151 284 164 193 153 20 153... |
correct output |
---|
63 240 115 257 206 66 42 113 2... |
user output |
---|
3 3 3 3 1 3 3 2 2 3 5 5 4 4 2 ... |
Test 14
Verdict: WRONG ANSWER
input |
---|
300 127 280 20 1 186 215 59 101 25... |
correct output |
---|
10 257 179 56 174 135 42 169 2... |
user output |
---|
1 2 2 1 2 2 1 1 1 1 2 2 2 2 1 ... |
Test 15
Verdict: WRONG ANSWER
input |
---|
300 81 283 149 69 227 39 144 70 28... |
correct output |
---|
207 54 241 126 151 138 118 51 ... |
user output |
---|
2 2 1 1 1 1 1 1 1 3 3 3 1 1 2 ... |
Test 16
Verdict: WRONG ANSWER
input |
---|
300 12 265 12 226 196 226 179 185 ... |
correct output |
---|
220 198 242 11 256 125 212 174... |
user output |
---|
1 1 1 1 1 1 1 1 2 2 1 2 2 1 1 ... |
Test 17
Verdict: WRONG ANSWER
input |
---|
300 91 60 106 191 300 27 191 10 28... |
correct output |
---|
247 142 103 178 256 9 154 16 8... |
user output |
---|
1 2 2 1 1 1 2 2 1 1 1 1 1 1 1 ... |
Test 18
Verdict: WRONG ANSWER
input |
---|
400 331 329 307 121 72 279 344 213... |
correct output |
---|
346 367 343 332 11 100 44 77 1... |
user output |
---|
3 5 5 4 2 1 2 3 4 4 2 2 2 3 3 ... |
Test 19
Verdict: WRONG ANSWER
input |
---|
400 305 158 217 151 291 189 338 26... |
correct output |
---|
114 319 34 163 183 13 175 87 3... |
user output |
---|
4 4 3 3 1 1 2 2 2 2 1 1 1 1 2 ... |
Test 20
Verdict: WRONG ANSWER
input |
---|
400 354 21 151 275 188 159 154 328... |
correct output |
---|
232 184 314 111 112 227 393 5 ... |
user output |
---|
1 1 2 2 1 1 1 3 4 4 4 4 2 2 1 ... |
Test 21
Verdict: WRONG ANSWER
input |
---|
400 279 376 349 253 29 112 157 110... |
correct output |
---|
131 226 382 240 276 66 136 190... |
user output |
---|
1 4 4 3 2 1 1 3 3 3 4 4 1 1 1 ... |
Test 22
Verdict: WRONG ANSWER
input |
---|
400 370 349 95 374 373 220 187 223... |
correct output |
---|
269 29 129 266 222 394 395 275... |
user output |
---|
1 1 1 2 4 4 4 4 2 1 1 2 2 2 5 ... |
Test 23
Verdict: WRONG ANSWER
input |
---|
500 55 153 455 345 272 93 24 440 4... |
correct output |
---|
69 104 10 499 433 251 337 470 ... |
user output |
---|
1 1 1 1 1 1 1 1 1 1 1 1 1 3 3 ... |
Test 24
Verdict: WRONG ANSWER
input |
---|
500 297 2 308 68 421 288 151 117 3... |
correct output |
---|
494 444 419 370 107 261 439 16... |
user output |
---|
1 2 3 4 4 3 4 4 3 2 3 4 4 1 1 ... |
Test 25
Verdict: WRONG ANSWER
input |
---|
500 448 452 207 81 168 458 431 499... |
correct output |
---|
445 117 188 206 156 438 321 13... |
user output |
---|
2 2 2 3 4 5 6 6 1 1 2 3 3 2 2 ... |
Test 26
Verdict: WRONG ANSWER
input |
---|
500 462 261 399 462 328 277 22 319... |
correct output |
---|
73 258 171 245 148 181 110 297... |
user output |
---|
2 2 1 2 2 2 3 3 2 4 4 3 3 2 2 ... |
Test 27
Verdict: WRONG ANSWER
input |
---|
500 344 249 220 264 277 322 90 164... |
correct output |
---|
36 419 257 318 414 355 179 107... |
user output |
---|
1 1 1 1 1 1 1 4 4 3 3 1 2 2 1 ... |
Test 28
Verdict: WRONG ANSWER
input |
---|
600 518 98 32 91 331 69 562 488 31... |
correct output |
---|
438 286 235 368 340 354 338 39... |
user output |
---|
2 2 2 2 1 1 3 3 2 1 1 3 3 3 3 ... |
Test 29
Verdict: WRONG ANSWER
input |
---|
600 107 462 245 156 410 126 414 28... |
correct output |
---|
116 194 344 560 59 337 543 233... |
user output |
---|
1 1 3 3 2 1 2 2 1 1 1 1 1 1 1 ... |
Test 30
Verdict: WRONG ANSWER
input |
---|
600 158 283 486 462 491 341 528 83... |
correct output |
---|
581 301 19 557 374 433 396 278... |
user output |
---|
1 1 2 2 1 1 1 1 1 2 2 2 2 1 1 ... |
Test 31
Verdict: WRONG ANSWER
input |
---|
600 222 353 470 77 426 573 201 36 ... |
correct output |
---|
346 194 423 385 43 161 373 154... |
user output |
---|
2 2 2 2 2 2 1 1 1 1 1 1 1 2 2 ... |
Test 32
Verdict: WRONG ANSWER
input |
---|
600 563 593 20 438 30 525 291 199 ... |
correct output |
---|
275 171 292 426 133 136 285 21... |
user output |
---|
1 2 2 2 4 4 4 4 4 4 3 3 1 1 2 ... |
Test 33
Verdict: WRONG ANSWER
input |
---|
700 578 320 44 92 179 368 524 61 5... |
correct output |
---|
127 21 504 411 619 214 103 230... |
user output |
---|
1 2 2 1 2 2 1 1 1 1 3 3 3 3 1 ... |
Test 34
Verdict: WRONG ANSWER
input |
---|
700 172 367 171 680 68 431 90 465 ... |
correct output |
---|
336 263 10 104 370 572 544 173... |
user output |
---|
1 4 4 3 2 1 2 2 1 1 1 1 1 2 2 ... |
Test 35
Verdict: WRONG ANSWER
input |
---|
700 592 485 633 263 13 500 234 164... |
correct output |
---|
580 329 635 17 574 191 672 280... |
user output |
---|
1 1 1 1 1 2 2 3 4 5 5 4 2 2 2 ... |
Test 36
Verdict: WRONG ANSWER
input |
---|
700 281 479 279 98 11 309 125 538 ... |
correct output |
---|
509 340 171 226 298 317 16 200... |
user output |
---|
3 3 2 1 1 2 2 1 1 2 2 3 3 2 1 ... |
Test 37
Verdict: WRONG ANSWER
input |
---|
700 129 142 226 50 471 445 533 580... |
correct output |
---|
69 96 324 645 208 167 652 431 ... |
user output |
---|
1 1 1 2 2 1 1 1 1 1 1 1 1 1 1 ... |
Test 38
Verdict: WRONG ANSWER
input |
---|
800 299 797 180 295 481 278 317 59... |
correct output |
---|
149 251 709 708 421 733 798 24... |
user output |
---|
1 1 1 1 1 1 2 2 1 1 1 1 1 1 2 ... |
Test 39
Verdict: WRONG ANSWER
input |
---|
800 61 61 439 356 175 216 137 325 ... |
correct output |
---|
792 30 44 426 502 39 390 264 3... |
user output |
---|
2 2 1 1 1 1 2 2 1 1 1 1 1 1 1 ... |
Test 40
Verdict: WRONG ANSWER
input |
---|
800 310 772 726 621 51 556 795 711... |
correct output |
---|
318 161 733 86 72 271 483 670 ... |
user output |
---|
1 1 1 3 3 2 1 2 2 1 1 1 1 2 2 ... |
Test 41
Verdict: WRONG ANSWER
input |
---|
800 24 46 39 770 278 218 657 362 7... |
correct output |
---|
566 303 132 186 47 504 78 356 ... |
user output |
---|
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ... |
Test 42
Verdict: WRONG ANSWER
input |
---|
800 166 688 171 741 50 312 299 562... |
correct output |
---|
119 186 291 331 48 603 575 162... |
user output |
---|
2 2 1 1 1 1 2 3 3 3 3 2 1 2 2 ... |
Test 43
Verdict: WRONG ANSWER
input |
---|
900 793 286 814 824 112 575 524 54... |
correct output |
---|
40 835 125 199 491 175 355 624... |
user output |
---|
1 2 2 1 2 4 4 2 1 2 4 4 2 1 2 ... |
Test 44
Verdict: WRONG ANSWER
input |
---|
900 86 520 750 436 711 598 268 322... |
correct output |
---|
485 569 557 653 321 748 277 12... |
user output |
---|
1 1 1 1 2 2 1 1 1 1 1 2 2 1 1 ... |
Test 45
Verdict: WRONG ANSWER
input |
---|
900 3 211 842 343 877 364 381 214 ... |
correct output |
---|
335 639 155 81 727 888 416 752... |
user output |
---|
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ... |
Test 46
Verdict: WRONG ANSWER
input |
---|
900 685 497 629 389 831 507 57 228... |
correct output |
---|
425 843 342 667 650 180 448 57... |
user output |
---|
1 2 2 2 2 2 2 2 2 1 3 3 4 4 4 ... |
Test 47
Verdict: WRONG ANSWER
input |
---|
900 158 489 267 475 847 29 542 314... |
correct output |
---|
467 792 741 221 125 49 266 887... |
user output |
---|
1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 ... |
Test 48
Verdict: WRONG ANSWER
input |
---|
1000 588 544 250 749 769 456 423 98... |
correct output |
---|
329 138 847 4 250 240 598 786 ... |
user output |
---|
2 2 2 2 1 1 2 2 1 1 1 1 1 3 3 ... |
Test 49
Verdict: WRONG ANSWER
input |
---|
1000 998 174 882 645 585 920 107 17... |
correct output |
---|
180 42 847 338 228 166 612 827... |
user output |
---|
3 3 2 1 1 1 2 3 3 1 1 3 3 2 2 ... |
Test 50
Verdict: WRONG ANSWER
input |
---|
1000 805 235 974 610 433 854 903 20... |
correct output |
---|
126 86 658 500 711 231 921 615... |
user output |
---|
1 1 1 1 1 2 2 1 1 2 2 3 3 2 1 ... |
Test 51
Verdict: WRONG ANSWER
input |
---|
1000 598 148 206 204 622 95 358 928... |
correct output |
---|
296 283 952 288 354 907 915 77... |
user output |
---|
1 1 2 2 1 2 3 3 2 2 1 1 1 1 2 ... |
Test 52
Verdict: WRONG ANSWER
input |
---|
1000 490 683 469 136 805 544 246 51... |
correct output |
---|
31 957 649 565 32 475 315 811 ... |
user output |
---|
1 2 2 2 2 2 2 1 1 1 3 3 2 2 2 ... |
Test 53
Verdict: TIME LIMIT EXCEEDED
input |
---|
100000 4944 311 69209 28682 87084 233... |
correct output |
---|
78792 8393 13826 63615 17735 1... |
user output |
---|
(empty) |
Test 54
Verdict: TIME LIMIT EXCEEDED
input |
---|
100000 34704 25911 59988 65186 29855 ... |
correct output |
---|
44265 90477 6685 27459 49090 5... |
user output |
---|
(empty) |
Test 55
Verdict: TIME LIMIT EXCEEDED
input |
---|
100000 32646 4868 34091 77349 54878 6... |
correct output |
---|
69142 94411 68862 51664 42109 ... |
user output |
---|
(empty) |
Test 56
Verdict: TIME LIMIT EXCEEDED
input |
---|
100000 50383 56465 63211 49461 99139 ... |
correct output |
---|
95420 71427 95626 67011 82375 ... |
user output |
---|
(empty) |
Test 57
Verdict: TIME LIMIT EXCEEDED
input |
---|
100000 94540 25313 57758 7201 51119 4... |
correct output |
---|
79187 70032 63831 69384 51604 ... |
user output |
---|
(empty) |
Test 58
Verdict: TIME LIMIT EXCEEDED
input |
---|
100000 14300 28427 96935 52311 13463 ... |
correct output |
---|
5395 57047 3087 83662 90503 24... |
user output |
---|
(empty) |
Test 59
Verdict: TIME LIMIT EXCEEDED
input |
---|
100000 14543 20265 6813 97256 2007 32... |
correct output |
---|
16434 64136 27052 56089 37320 ... |
user output |
---|
(empty) |
Test 60
Verdict: TIME LIMIT EXCEEDED
input |
---|
100000 87233 22493 10433 86194 52186 ... |
correct output |
---|
62003 25428 66260 57053 59291 ... |
user output |
---|
(empty) |
Test 61
Verdict: TIME LIMIT EXCEEDED
input |
---|
100000 83612 41781 34903 19741 34951 ... |
correct output |
---|
29843 44886 70357 52228 52247 ... |
user output |
---|
(empty) |
Test 62
Verdict: WRONG ANSWER
input |
---|
99995 1 2 2 4 4 6 6 8 8 10 10 12 12 ... |
correct output |
---|
99995 49998 99994 49997 99993 ... |
user output |
---|
1 2 2 1 1 1 1 1 1 1 1 1 1 1 1 ... |
Test 63
Verdict: WRONG ANSWER
input |
---|
100000 1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
correct output |
---|
100000 99999 99998 99997 99996... |
user output |
---|
1 1 2 2 1 1 1 1 1 1 1 1 1 1 1 ... |