QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#409555 | #7680. Subway | light_ink_dots | AC ✓ | 1ms | 4112kb | C++14 | 1.1kb | 2024-05-12 11:08:58 | 2024-05-12 11:09:00 |
Judging History
answer
//We are Rock dayo!
#include <bits/stdc++.h>
using namespace std;
int main() {
static const int maxn = 60, B = 5000;
int n, mx = 0;
scanf("%d", &n);
struct point {
int x, y, a;
};
static point p[maxn];
int mn=1e9;
for (int i = 1; i <= n; i++) scanf("%d %d %d", &p[i].x, &p[i].y, &p[i].a), mx = max(mx, p[i].a),mn=min(mn,p[i].a);
// (1,2*B) -> (2,4*B+1)
sort(p + 1, p + n + 1,
[](const point x, const point y) { return 2*x.x + (4 * B +1) * x.y < 2*y.x + (4 * B+1) * y.y; });
printf("%d\n", mx);
for (int l = 1; l <= mx; l++) {
int dx = ( - (4*B+1) * (B + l -1)) - 2*B , dy = (B + l -1)*2+1;
vector<pair<int, int>> ans;
int l1=1,r=n;
for (int i = l1; i <= r; i++) {
if(p[i].a>=l)
ans.emplace_back(p[i].x, p[i].y);
ans.emplace_back(p[i].x + dx, p[i].y + dy);
}
// if(n==50&&l==2) continue;
printf("%d", (int)ans.size());
for (auto p : ans) printf(" %d %d", p.first, p.second);
printf("\n");
}
return 0;
}
这程序好像有点Bug,我给组数据试试?
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3828kb
input:
3 1 2 1 2 1 2 3 3 2
output:
2 6 2 1 -100014998 10002 1 2 -100014999 10003 3 3 -100014997 10004 5 2 1 -100034999 10004 -100035000 10005 3 3 -100034998 10006
result:
ok ok Sum L = 11
Test #2:
score: 0
Accepted
time: 0ms
memory: 4080kb
input:
1 1 1 1
output:
1 2 1 1 -100014999 10002
result:
ok ok Sum L = 2
Test #3:
score: 0
Accepted
time: 0ms
memory: 3836kb
input:
1 1 1 50
output:
50 2 1 1 -100014999 10002 2 1 1 -100035000 10004 2 1 1 -100055001 10006 2 1 1 -100075002 10008 2 1 1 -100095003 10010 2 1 1 -100115004 10012 2 1 1 -100135005 10014 2 1 1 -100155006 10016 2 1 1 -100175007 10018 2 1 1 -100195008 10020 2 1 1 -100215009 10022 2 1 1 -100235010 10024 2 1 1 -100255011 1002...
result:
ok ok Sum L = 100
Test #4:
score: 0
Accepted
time: 1ms
memory: 3856kb
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 100 961 -919 -100014039 9082 -306 -897 -100015306 9104 334 -893 -100014666 9108 -371 -812 -100015371 9189 -885 -775 -100015885 9226 -668 -725 -100015668 9276 -462 -719 -100015462 9282 202 -702 -100014798 9299 -870 -697 -100015870 9304 -888 -667 -100015888 9334 -548 -652 -100015548 9349 662 -567 -...
result:
ok ok Sum L = 3693
Test #5:
score: 0
Accepted
time: 0ms
memory: 3832kb
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 -162 -959 -100015162 9042 -756 -909 -100015756 9092 -192 -890 -100015192 9111 30 -869 -100014970 9132 -197 -795 -100015197 9206 749 -723 -100014251 9278 -571 -716 -100015571 9285 -216 -711 -100015216 9290 -273 -672 -100015273 9329 473 -639 -100014527 9362 333 -637 -100014667 9364 360 -630 -100...
result:
ok ok Sum L = 100
Test #6:
score: 0
Accepted
time: 0ms
memory: 4104kb
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 100 356 -986 -100014644 9015 348 -975 -100014652 9026 -552 -966 -100015552 9035 618 -911 -100014382 9090 846 -893 -100014154 9108 594 -847 -100014406 9154 674 -804 -100014326 9197 -637 -801 -100015637 9200 871 -799 -100014129 9202 17 -757 -100014983 9244 -615 -675 -100015615 9326 840 -638 -1000141...
result:
ok ok Sum L = 391
Test #7:
score: 0
Accepted
time: 0ms
memory: 4112kb
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 100 -313 -996 -100015313 9005 -285 -980 -100015285 9021 -767 -974 -100015767 9027 932 -941 -100014068 9060 -258 -938 -100015258 9063 -813 -921 -100015813 9080 -325 -875 -100015325 9126 -19 -845 -100015019 9156 166 -766 -100014834 9235 -560 -748 -100015560 9253 -397 -741 -100015397 9260 -189 -728 ...
result:
ok ok Sum L = 781
Test #8:
score: 0
Accepted
time: 1ms
memory: 3880kb
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 100 75 -958 -100014925 9043 -282 -917 -100015282 9084 24 -889 -100014976 9112 173 -857 -100014827 9144 273 -830 -100014727 9171 808 -695 -100014192 9306 537 -637 -100014463 9364 -749 -631 -100015749 9370 938 -596 -100014062 9405 -515 -540 -100015515 9461 -958 -511 -100015958 9490 -649 -479 -10001...
result:
ok ok Sum L = 4768
Test #9:
score: 0
Accepted
time: 0ms
memory: 4076kb
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 -302 -989 -100015302 9012 267 -965 -100014733 9036 -367 -951 -100015367 9050 417 -944 -100014583 9057 197 -923 -100014803 9078 481 -873 -100014519 9128 -126 -799 -100015126 9202 643 -779 -100014357 9222 913 -700 -100014087 9301 498 -636 -100014502 9365 150 -618 -100014850 9383 -882 -602 -1000...
result:
ok ok Sum L = 5000
Test #10:
score: 0
Accepted
time: 1ms
memory: 3820kb
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 100 -2 -5 -100015002 9996 0 -5 -100015000 9996 1 -5 -100014999 9996 2 -5 -100014998 9996 -5 -4 -100015005 9997 -4 -4 -100015004 9997 -1 -4 -100015001 9997 0 -4 -100015000 9997 1 -4 -100014999 9997 5 -4 -100014995 9997 -5 -3 -100015005 9998 -4 -3 -100015004 9998 -3 -3 -100015003 9998 0 -3 -1000150...
result:
ok ok Sum L = 3924
Test #11:
score: 0
Accepted
time: 0ms
memory: 3884kb
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 100 -5 -5 -100015005 9996 3 -5 -100014997 9996 5 -5 -100014995 9996 -4 -4 -100015004 9997 -3 -4 -100015003 9997 -2 -4 -100015002 9997 -1 -4 -100015001 9997 1 -4 -100014999 9997 2 -4 -100014998 9997 -5 -3 -100015005 9998 -3 -3 -100015003 9998 2 -3 -100014998 9998 3 -3 -100014997 9998 -3 -2 -1000150...
result:
ok ok Sum L = 186
Test #12:
score: 0
Accepted
time: 1ms
memory: 3820kb
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 100 -5 -5 -100015005 9996 -4 -5 -100015004 9996 -3 -5 -100015003 9996 -1 -5 -100015001 9996 1 -5 -100014999 9996 2 -5 -100014998 9996 -3 -4 -100015003 9997 -2 -4 -100015002 9997 -1 -4 -100015001 9997 0 -4 -100015000 9997 1 -4 -100014999 9997 4 -4 -100014996 9997 -5 -3 -100015005 9998 -2 -3 -10001...
result:
ok ok Sum L = 4977
Test #13:
score: 0
Accepted
time: 0ms
memory: 4104kb
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 100 114 514 -100014886 10515 115 514 -100014885 10515 116 514 -100014884 10515 117 514 -100014883 10515 118 514 -100014882 10515 119 514 -100014881 10515 120 514 -100014880 10515 121 514 -100014879 10515 122 514 -100014878 10515 123 514 -100014877 10515 124 514 -100014876 10515 125 514 -100014875...
result:
ok ok Sum L = 3602
Test #14:
score: 0
Accepted
time: 1ms
memory: 3776kb
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 100 191 932 -100014809 10933 191 933 -100014809 10934 191 934 -100014809 10935 191 935 -100014809 10936 191 936 -100014809 10937 191 937 -100014809 10938 191 938 -100014809 10939 191 939 -100014809 10940 191 940 -100014809 10941 191 941 -100014809 10942 191 942 -100014809 10943 191 943 -100014809...
result:
ok ok Sum L = 3602
Test #15:
score: 0
Accepted
time: 1ms
memory: 3824kb
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 100 -123 456 -100015123 10457 -122 457 -100015122 10458 -121 458 -100015121 10459 -120 459 -100015120 10460 -119 460 -100015119 10461 -118 461 -100015118 10462 -117 462 -100015117 10463 -116 463 -100015116 10464 -115 464 -100015115 10465 -114 465 -100015114 10466 -113 466 -100015113 10467 -112 46...
result:
ok ok Sum L = 3706
Test #16:
score: 0
Accepted
time: 1ms
memory: 3848kb
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 100 370 -574 -100014630 9427 369 -573 -100014631 9428 368 -572 -100014632 9429 367 -571 -100014633 9430 366 -570 -100014634 9431 365 -569 -100014635 9432 364 -568 -100014636 9433 363 -567 -100014637 9434 362 -566 -100014638 9435 361 -565 -100014639 9436 360 -564 -100014640 9437 359 -563 -10001464...
result:
ok ok Sum L = 3712
Test #17:
score: 0
Accepted
time: 1ms
memory: 3828kb
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 100 -493 -604 -100015493 9397 -492 -603 -100015492 9398 -491 -602 -100015491 9399 -490 -601 -100015490 9400 -489 -600 -100015489 9401 -488 -599 -100015488 9402 -487 -598 -100015487 9403 -486 -597 -100015486 9404 -485 -596 -100015485 9405 -484 -595 -100015484 9406 -483 -594 -100015483 9407 -482 -5...
result:
ok ok Sum L = 3661
Test #18:
score: 0
Accepted
time: 0ms
memory: 3788kb
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 100 -142 0 -100015142 10001 -143 1 -100015143 10002 -144 2 -100015144 10003 -145 3 -100015145 10004 -146 4 -100015146 10005 -147 5 -100015147 10006 -148 6 -100015148 10007 -149 7 -100015149 10008 -150 8 -100015150 10009 -151 9 -100015151 10010 -152 10 -100015152 10011 -153 11 -100015153 10012 -15...
result:
ok ok Sum L = 3811
Test #19:
score: 0
Accepted
time: 0ms
memory: 4076kb
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 -1000 -1000 -100016000 9001 -999 -1000 -100015999 9001 999 -1000 -100014001 9001 1000 -1000 -100014000 9001 -1000 -999 -100016000 9002 1000 -999 -100014000 9002 -1000 999 -100016000 11000 1000 999 -100014000 11000 -1000 1000 -100016000 11001 -999 1000 -100015999 11001 999 1000 -100014001 11001...
result:
ok ok Sum L = 1200
Test #20:
score: 0
Accepted
time: 0ms
memory: 3832kb
input:
4 1000 1000 50 1000 -1000 50 -1000 1000 50 -1000 -1000 50
output:
50 8 -1000 -1000 -100016000 9001 1000 -1000 -100014000 9001 -1000 1000 -100016000 11001 1000 1000 -100014000 11001 8 -1000 -1000 -100036001 9003 1000 -1000 -100034001 9003 -1000 1000 -100036001 11003 1000 1000 -100034001 11003 8 -1000 -1000 -100056002 9005 1000 -1000 -100054002 9005 -1000 1000 -1000...
result:
ok ok Sum L = 400
Extra Test:
score: 0
Extra Test Passed