QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#618260 | #7680. Subway | zhangboju | AC ✓ | 1ms | 3708kb | C++14 | 1.2kb | 2024-10-06 20:11:54 | 2024-10-06 20:11:54 |
Judging History
answer
#include <bits/stdc++.h>
#include <utility>
using namespace std;
constexpr int N = 55;
int n;
struct node{
int x, y;
int nx, ny;
int cnt;
};
constexpr int magicx = 10001, magicy = 2;
node a[N];
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
cin >> n;
int maxx = 0;
for (int i = 1; i <= n; i++) {
cin >> a[i].x >> a[i].y >> a[i].cnt;
a[i].nx = a[i].x + magicy * N + 1;
a[i].ny = a[i].y - (magicx / magicy + 1) - magicx * N;
maxx = max(maxx, a[i].cnt);
}
sort(a + 1, a + n + 1, [&](auto a, auto b) {
return make_pair(a.x, a.y) < make_pair(b.x, b.y);
});
cout << maxx << "\n";
while (maxx) {
int cnt = 0;
for (int i = 1; i <= n; i++)
if (a[i].cnt == maxx)
cnt++;
cout << n + cnt << " ";
for (int i = 1; i <= n; i++) {
cout << a[i].nx << " " << a[i].ny << " ";
a[i].nx -= magicy;
a[i].ny += magicx;
if (a[i].cnt == maxx) {
cout << a[i].x << " " << a[i].y << " ";
a[i].cnt--;
}
}
cout << "\n";
maxx--;
}
}
这程序好像有点Bug,我给组数据试试?
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3576kb
input:
3 1 2 1 2 1 2 3 3 2
output:
2 5 112 -555054 113 -555055 2 1 114 -555053 3 3 6 110 -545053 1 2 111 -545054 2 1 112 -545052 3 3
result:
ok ok Sum L = 11
Test #2:
score: 0
Accepted
time: 0ms
memory: 3700kb
input:
1 1 1 1
output:
1 2 112 -555055 1 1
result:
ok ok Sum L = 2
Test #3:
score: 0
Accepted
time: 0ms
memory: 3576kb
input:
1 1 1 50
output:
50 2 112 -555055 1 1 2 110 -545054 1 1 2 108 -535053 1 1 2 106 -525052 1 1 2 104 -515051 1 1 2 102 -505050 1 1 2 100 -495049 1 1 2 98 -485048 1 1 2 96 -475047 1 1 2 94 -465046 1 1 2 92 -455045 1 1 2 90 -445044 1 1 2 88 -435043 1 1 2 86 -425042 1 1 2 84 -415041 1 1 2 82 -405040 1 1 2 ...
result:
ok ok Sum L = 100
Test #4:
score: 0
Accepted
time: 1ms
memory: 3696kb
input:
50 662 -567 48 728 -120 7 307 669 27 -885 -775 21 100 242 9 -784 -537 41 940 198 46 736 -551 30 -449 456 16 -945 382 18 -182 810 49 213 187 44 853 245 48 617 -305 19 -81 261 3 617 208 8 -548 -652 6 -888 -667 14 -371 -812 43 202 -702 10 -668 -725 5 961 -919 33 -870 -697 50 428 810 29 560 405 7 348 -3...
output:
50 52 -870 -555249 -834 -554674 -815 -554385 -777 -555723 -774 -555831 -759 -555753 -870 -697 -714 -554675 -673 -555593 -572 -554325 -557 -555781 -468 -555493 -447 -554231 -437 -555708 -388 -555233 -358 -555312 -351 -555775 -338 -554600 -260 -555868 -220 -554880 -195 -555953 -94 -555121 -71 -554246 ...
result:
ok ok Sum L = 3693
Test #5:
score: 0
Accepted
time: 0ms
memory: 3644kb
input:
50 -772 697 1 -756 -909 1 659 923 1 850 471 1 260 -24 1 473 -639 1 -575 393 1 -466 197 1 333 -637 1 -192 -890 1 103 546 1 749 -723 1 -573 613 1 214 -138 1 277 928 1 266 291 1 911 275 1 -680 -67 1 69 190 1 -197 -795 1 684 618 1 729 -115 1 -658 -229 1 -595 -470 1 898 -172 1 401 81 1 133 685 1 223 400 ...
output:
1 100 -661 -554359 -772 697 -645 -555965 -756 -909 -569 -555123 -680 -67 -555 -555138 -666 -82 -547 -555285 -658 -229 -484 -555526 -595 -470 -464 -554663 -575 393 -462 -554443 -573 613 -460 -555772 -571 -716 -421 -554218 -532 838 -419 -554166 -530 890 -355 -554859 -466 197 -278 -554348 -389 708 -235...
result:
ok ok Sum L = 100
Test #6:
score: 0
Accepted
time: 0ms
memory: 3660kb
input:
50 -56 747 3 993 -490 4 930 -139 1 -298 -330 1 938 -351 5 -973 100 5 -472 44 4 345 628 5 481 -91 4 789 581 5 457 -29 4 871 -799 1 692 994 4 699 854 2 893 -33 1 -483 256 3 -962 -540 2 846 -893 1 830 609 5 845 -383 2 -552 -966 1 -544 -51 1 564 186 4 -615 -675 1 618 -911 3 -561 -302 4 -293 667 3 -334 -...
output:
5 58 -888 -554726 -862 -554956 -973 100 -851 -555596 -777 -555669 -731 -554675 -681 -555681 -526 -555857 -504 -555731 -450 -555358 -441 -556022 -433 -555107 -372 -554800 -361 -555012 -253 -554887 -223 -555591 -187 -555386 -182 -554389 -122 -555488 -233 -432 -48 -554447 7 -554084 55 -554309 64 -55466...
result:
ok ok Sum L = 391
Test #7:
score: 0
Accepted
time: 0ms
memory: 3652kb
input:
50 600 997 5 -893 -204 3 408 443 1 -560 -748 7 -647 161 6 -285 -980 1 87 -582 7 -48 -721 7 997 285 2 -189 -728 8 525 222 4 -324 816 9 760 317 3 753 -480 10 -813 -921 3 -325 -875 8 -747 816 10 -627 605 7 775 786 6 136 -54 2 274 948 10 216 -113 7 924 68 3 101 576 8 60 -501 2 898 801 8 -767 -974 10 -99...
output:
10 54 -871 -555268 -869 -554303 -861 -555368 -782 -555260 -702 -555977 -694 -555360 -656 -556030 -767 -974 -636 -554240 -747 816 -549 -555391 -536 -554895 -516 -554451 -449 -555804 -387 -555514 -308 -554492 -286 -555797 -238 -555219 -214 -555931 -213 -554240 -202 -556052 -174 -556036 -167 -555654 -1...
result:
ok ok Sum L = 781
Test #8:
score: 0
Accepted
time: 0ms
memory: 3640kb
input:
50 24 -889 49 117 418 49 25 524 44 980 -416 43 -494 357 41 -287 -285 46 151 574 41 -289 68 49 -515 -540 41 -367 -178 47 -887 151 45 197 -272 47 714 724 45 -737 94 49 810 830 47 808 -695 41 537 -637 49 -142 -167 44 -749 -631 47 445 -444 42 801 910 43 59 363 42 -912 466 50 -649 -479 48 -958 -511 49 88...
output:
50 53 -887 -554713 -847 -555567 -801 -554590 -912 466 -776 -554905 -757 -555170 -868 -114 -675 -555440 -638 -555687 -626 -554962 -538 -555535 -504 -554247 -477 -555194 -404 -555596 -383 -554699 -375 -554190 -256 -555234 -197 -554404 -178 -554988 -176 -555341 -171 -555973 -157 -555095 -101 -555030 -2...
result:
ok ok Sum L = 4768
Test #9:
score: 0
Accepted
time: 1ms
memory: 3588kb
input:
50 151 -171 50 -367 -951 50 808 569 50 150 -618 50 27 -476 50 -846 729 50 549 -456 50 50 646 50 294 -70 50 -571 104 50 128 -265 50 913 -700 50 267 -965 50 896 846 50 -2 713 50 21 679 50 -515 975 50 168 180 50 -369 -98 50 676 115 50 643 -779 50 920 -237 50 -324 450 50 149 -378 50 -882 -602 50 -126 -7...
output:
50 100 -771 -555658 -882 -602 -740 -554777 -851 279 -735 -554327 -846 729 -730 -554455 -841 601 -493 -555224 -604 -168 -460 -554952 -571 104 -433 -554749 -544 307 -404 -554081 -515 975 -390 -554129 -501 927 -363 -554276 -474 780 -258 -555154 -369 -98 -256 -556007 -367 -951 -224 -555000 -335 56 -213 ...
result:
ok ok Sum L = 5000
Test #10:
score: 0
Accepted
time: 0ms
memory: 3656kb
input:
50 4 5 34 1 -5 24 -4 -4 32 -3 3 28 0 -1 21 1 -4 25 0 0 30 0 -4 42 -3 -2 44 -5 -3 37 4 -1 46 5 2 20 2 2 37 -2 5 35 -2 -1 39 2 4 32 -4 -3 42 0 3 32 3 5 47 -4 1 2 5 -1 17 -5 -4 5 -2 2 29 -5 1 11 2 -5 43 4 4 14 -5 0 9 0 -5 17 5 1 27 -3 0 24 -1 4 16 5 0 50 3 -2 18 1 -2 6 2 -1 29 -1 3 38 1 5 36 -3 1 28 -3...
output:
50 51 106 -555060 106 -555059 106 -555056 106 -555055 107 -555060 107 -555059 107 -555055 108 -555059 108 -555058 108 -555057 108 -555056 108 -555055 108 -555053 108 -555051 109 -555061 109 -555057 109 -555054 109 -555051 110 -555060 110 -555053 110 -555052 110 -555051 111 -555061 111 -555060 111 -5...
result:
ok ok Sum L = 3924
Test #11:
score: 0
Accepted
time: 0ms
memory: 3652kb
input:
50 2 0 2 2 -3 2 4 1 2 -3 -3 2 -5 1 2 5 3 2 -5 -3 2 -3 -2 2 2 -1 2 2 3 2 4 4 1 1 -4 1 5 -1 2 -4 1 2 3 -2 1 -1 2 2 5 -5 2 -2 1 2 -5 -1 2 -2 -1 2 -1 -2 2 5 5 1 0 -2 2 1 1 1 2 2 2 3 5 2 -2 -4 1 -3 5 1 4 2 2 -4 -4 2 -3 2 1 5 0 2 -2 -2 2 -4 4 1 -2 5 2 2 5 1 3 -5 2 -4 5 2 -5 5 2 -2 4 2 -5 -5 2 -2 2 2 -3 -4...
output:
2 86 106 -555061 -5 -5 106 -555059 -5 -3 106 -555057 -5 -1 106 -555055 -5 1 106 -555051 -5 5 107 -555060 -4 -4 107 -555055 -4 1 107 -555052 107 -555051 -4 5 108 -555060 -3 -4 108 -555059 -3 -3 108 -555058 -3 -2 108 -555056 -3 0 108 -555054 108 -555051 109 -555060 109 -555058 -2 -2 109 -555057 -2 -1 ...
result:
ok ok Sum L = 186
Test #12:
score: 0
Accepted
time: 1ms
memory: 3652kb
input:
50 4 3 49 -5 -3 49 0 -3 50 -2 -4 49 -5 -5 50 4 0 49 -1 -2 49 -2 0 49 1 2 50 -1 -5 50 -5 -1 50 -5 5 49 2 0 50 -2 -3 50 -4 -5 50 0 -2 50 -5 4 50 -1 1 49 -1 -4 49 -3 -1 49 1 -3 50 -4 1 50 0 5 50 1 -2 50 -1 5 50 4 2 50 4 -3 49 1 -4 49 -1 -1 49 -3 -5 50 4 -4 50 3 2 49 3 -3 49 0 2 50 -3 -4 49 5 -1 49 -3 5...
output:
50 77 106 -555061 -5 -5 106 -555059 106 -555057 -5 -1 106 -555052 -5 4 106 -555051 107 -555061 -4 -5 107 -555055 -4 1 107 -555052 -4 4 108 -555061 -3 -5 108 -555060 108 -555057 108 -555051 109 -555060 109 -555059 -2 -3 109 -555056 109 -555053 -2 3 110 -555061 -1 -5 110 -555060 110 -555058 110 -55505...
result:
ok ok Sum L = 4977
Test #13:
score: 0
Accepted
time: 1ms
memory: 3656kb
input:
50 114 514 30 115 514 41 116 514 6 117 514 49 118 514 10 119 514 49 120 514 1 121 514 7 122 514 3 123 514 4 124 514 1 125 514 12 126 514 15 127 514 16 128 514 34 129 514 24 130 514 49 131 514 43 132 514 25 133 514 12 134 514 26 135 514 13 136 514 12 137 514 15 138 514 7 139 514 25 140 514 5 141 514 ...
output:
49 53 225 -554542 226 -554542 227 -554542 228 -554542 117 514 229 -554542 230 -554542 119 514 231 -554542 232 -554542 233 -554542 234 -554542 235 -554542 236 -554542 237 -554542 238 -554542 239 -554542 240 -554542 241 -554542 130 514 242 -554542 243 -554542 244 -554542 245 -554542 246 -554542 247 -5...
result:
ok ok Sum L = 3602
Test #14:
score: 0
Accepted
time: 1ms
memory: 3708kb
input:
50 191 981 19 191 980 41 191 979 20 191 978 14 191 977 2 191 976 49 191 975 40 191 974 3 191 973 20 191 972 6 191 971 13 191 970 4 191 969 4 191 968 47 191 967 32 191 966 11 191 965 34 191 964 30 191 963 3 191 962 16 191 961 24 191 960 30 191 959 34 191 958 31 191 957 24 191 956 29 191 955 42 191 95...
output:
49 51 302 -554124 302 -554123 302 -554122 302 -554121 302 -554120 302 -554119 302 -554118 302 -554117 302 -554116 302 -554115 302 -554114 302 -554113 302 -554112 302 -554111 302 -554110 302 -554109 302 -554108 302 -554107 302 -554106 302 -554105 302 -554104 302 -554103 302 -554102 302 -554101 302 -5...
result:
ok ok Sum L = 3602
Test #15:
score: 0
Accepted
time: 1ms
memory: 3584kb
input:
50 -123 456 47 -122 457 35 -121 458 25 -120 459 35 -119 460 30 -118 461 33 -117 462 21 -116 463 31 -115 464 21 -114 465 35 -113 466 20 -112 467 17 -111 468 25 -110 469 3 -109 470 29 -108 471 35 -107 472 4 -106 473 44 -105 474 4 -104 475 28 -103 476 49 -102 477 9 -101 478 39 -100 479 9 -99 480 21 -98...
output:
50 52 -12 -554600 -11 -554599 -10 -554598 -9 -554597 -8 -554596 -7 -554595 -6 -554594 -5 -554593 -4 -554592 -3 -554591 -2 -554590 -1 -554589 0 -554588 1 -554587 2 -554586 3 -554585 4 -554584 5 -554583 6 -554582 7 -554581 8 -554580 9 -554579 10 -554578 11 -554577 12 -554576 13 -554575 14 -554574 15 -...
result:
ok ok Sum L = 3706
Test #16:
score: 0
Accepted
time: 1ms
memory: 3580kb
input:
50 321 -525 46 322 -526 14 323 -527 16 324 -528 38 325 -529 22 326 -530 24 327 -531 48 328 -532 5 329 -533 7 330 -534 30 331 -535 25 332 -536 2 333 -537 13 334 -538 1 335 -539 33 336 -540 8 337 -541 9 338 -542 2 339 -543 29 340 -544 17 341 -545 41 342 -546 39 343 -547 9 344 -548 47 345 -549 47 346 -...
output:
50 51 432 -555581 433 -555582 434 -555583 435 -555584 436 -555585 437 -555586 438 -555587 439 -555588 440 -555589 441 -555590 442 -555591 443 -555592 444 -555593 445 -555594 446 -555595 447 -555596 448 -555597 449 -555598 450 -555599 451 -555600 452 -555601 453 -555602 454 -555603 455 -555604 456 -5...
result:
ok ok Sum L = 3712
Test #17:
score: 0
Accepted
time: 1ms
memory: 3648kb
input:
50 -444 -555 23 -445 -556 32 -446 -557 36 -447 -558 29 -448 -559 4 -449 -560 25 -450 -561 29 -451 -562 5 -452 -563 9 -453 -564 28 -454 -565 35 -455 -566 26 -456 -567 22 -457 -568 39 -458 -569 13 -459 -570 50 -460 -571 37 -461 -572 14 -462 -573 26 -463 -574 49 -464 -575 23 -465 -576 44 -466 -577 2 -4...
output:
50 52 -382 -555660 -381 -555659 -380 -555658 -379 -555657 -378 -555656 -377 -555655 -488 -599 -376 -555654 -375 -555653 -374 -555652 -373 -555651 -372 -555650 -371 -555649 -370 -555648 -369 -555647 -368 -555646 -367 -555645 -366 -555644 -365 -555643 -364 -555642 -363 -555641 -362 -555640 -361 -55563...
result:
ok ok Sum L = 3661
Test #18:
score: 0
Accepted
time: 1ms
memory: 3636kb
input:
50 -142 0 48 -143 1 22 -144 2 45 -145 3 9 -146 4 36 -147 5 46 -148 6 26 -149 7 26 -150 8 9 -151 9 19 -152 10 22 -153 11 14 -154 12 8 -155 13 20 -156 14 41 -157 15 47 -158 16 22 -159 17 50 -160 18 3 -161 19 12 -162 20 15 -163 21 32 -164 22 46 -165 23 45 -166 24 3 -167 25 27 -168 26 33 -169 27 17 -170...
output:
50 52 -80 -555007 -79 -555008 -78 -555009 -189 47 -77 -555010 -76 -555011 -75 -555012 -74 -555013 -73 -555014 -72 -555015 -71 -555016 -70 -555017 -69 -555018 -68 -555019 -67 -555020 -66 -555021 -65 -555022 -64 -555023 -63 -555024 -62 -555025 -61 -555026 -60 -555027 -59 -555028 -58 -555029 -57 -55503...
result:
ok ok Sum L = 3811
Test #19:
score: 0
Accepted
time: 0ms
memory: 3700kb
input:
12 1000 1000 50 1000 -1000 50 1000 999 50 999 1000 50 999 -1000 50 -999 1000 50 1000 -999 50 -999 -1000 50 -1000 1000 50 -1000 -1000 50 -1000 -999 50 -1000 999 50
output:
50 24 -889 -556056 -1000 -1000 -889 -556055 -1000 -999 -889 -554057 -1000 999 -889 -554056 -1000 1000 -888 -556056 -999 -1000 -888 -554056 -999 1000 1110 -556056 999 -1000 1110 -554056 999 1000 1111 -556056 1000 -1000 1111 -556055 1000 -999 1111 -554057 1000 999 1111 -554056 1000 1000 24 -891 -5460...
result:
ok ok Sum L = 1200
Test #20:
score: 0
Accepted
time: 0ms
memory: 3588kb
input:
4 1000 1000 50 1000 -1000 50 -1000 1000 50 -1000 -1000 50
output:
50 8 -889 -556056 -1000 -1000 -889 -554056 -1000 1000 1111 -556056 1000 -1000 1111 -554056 1000 1000 8 -891 -546055 -1000 -1000 -891 -544055 -1000 1000 1109 -546055 1000 -1000 1109 -544055 1000 1000 8 -893 -536054 -1000 -1000 -893 -534054 -1000 1000 1107 -536054 1000 -1000 1107 -534054 1000 1000 ...
result:
ok ok Sum L = 400
Extra Test:
score: 0
Extra Test Passed