QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#409295 | #7680. Subway | light_ink_dots | WA | 1ms | 3992kb | C++14 | 1.6kb | 2024-05-11 21:20:58 | 2024-05-11 21:20:58 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
int main() {
static const int maxn = 60, B = 10000;
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);
sort(p + 1, p + n + 1,
[](const point x, const point y) { return x.x + 2 * B * x.y < y.x + 2 * B * y.y; });
printf("%d\n", mx);
if(n==50){
// for(int i=1;i<=n;i++) p[i].a=mx;
// puts("2 -182 810 -200010182 10811");
// puts("3 -182 810 -200030182 10812 428 810");
}
for (int l = 1; l <= mx; l++) {
int dx = ( - 2 * (B + l)) * B+1 , dy = B + l;
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==1){
// printf("%d", (int)ans.size());
// for (auto p : ans) printf(" %d %d", p.first, p.second);
// printf("\n");
// continue;
}
// 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;
}
/*
2
-945 382 2
-825 381 2
*/
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3964kb
input:
3 1 2 1 2 1 2 3 3 2
output:
2 6 2 1 -200019997 10002 1 2 -200019998 10003 3 3 -200019996 10004 5 2 1 -200039997 10003 -200039998 10004 3 3 -200039996 10005
result:
ok ok Sum L = 11
Test #2:
score: 0
Accepted
time: 0ms
memory: 3692kb
input:
1 1 1 1
output:
1 2 1 1 -200019998 10002
result:
ok ok Sum L = 2
Test #3:
score: 0
Accepted
time: 1ms
memory: 3720kb
input:
1 1 1 50
output:
50 2 1 1 -200019998 10002 2 1 1 -200039998 10003 2 1 1 -200059998 10004 2 1 1 -200079998 10005 2 1 1 -200099998 10006 2 1 1 -200119998 10007 2 1 1 -200139998 10008 2 1 1 -200159998 10009 2 1 1 -200179998 10010 2 1 1 -200199998 10011 2 1 1 -200219998 10012 2 1 1 -200239998 10013 2 1 1 -200259998 1001...
result:
ok ok Sum L = 100
Test #4:
score: 0
Accepted
time: 1ms
memory: 3716kb
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 -200019038 9082 -306 -897 -200020305 9104 334 -893 -200019665 9108 -371 -812 -200020370 9189 -885 -775 -200020884 9226 -668 -725 -200020667 9276 -462 -719 -200020461 9282 202 -702 -200019797 9299 -870 -697 -200020869 9304 -888 -667 -200020887 9334 -548 -652 -200020547 9349 662 -567 -...
result:
ok ok Sum L = 3693
Test #5:
score: 0
Accepted
time: 1ms
memory: 3992kb
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 -200020161 9042 -756 -909 -200020755 9092 -192 -890 -200020191 9111 30 -869 -200019969 9132 -197 -795 -200020196 9206 749 -723 -200019250 9278 -571 -716 -200020570 9285 -216 -711 -200020215 9290 -273 -672 -200020272 9329 473 -639 -200019526 9362 333 -637 -200019666 9364 360 -630 -200...
result:
ok ok Sum L = 100
Test #6:
score: 0
Accepted
time: 0ms
memory: 3708kb
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 -200019643 9015 348 -975 -200019651 9026 -552 -966 -200020551 9035 618 -911 -200019381 9090 846 -893 -200019153 9108 594 -847 -200019405 9154 674 -804 -200019325 9197 -637 -801 -200020636 9200 871 -799 -200019128 9202 17 -757 -200019982 9244 -615 -675 -200020614 9326 840 -638 -2000191...
result:
ok ok Sum L = 391
Test #7:
score: 0
Accepted
time: 1ms
memory: 3744kb
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 -200020312 9005 -285 -980 -200020284 9021 -767 -974 -200020766 9027 932 -941 -200019067 9060 -258 -938 -200020257 9063 -813 -921 -200020812 9080 -325 -875 -200020324 9126 -19 -845 -200020018 9156 166 -766 -200019833 9235 -560 -748 -200020559 9253 -397 -741 -200020396 9260 -189 -728 ...
result:
ok ok Sum L = 781
Test #8:
score: 0
Accepted
time: 1ms
memory: 3988kb
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 -200019924 9043 -282 -917 -200020281 9084 24 -889 -200019975 9112 173 -857 -200019826 9144 273 -830 -200019726 9171 808 -695 -200019191 9306 537 -637 -200019462 9364 -749 -631 -200020748 9370 938 -596 -200019061 9405 -515 -540 -200020514 9461 -958 -511 -200020957 9490 -649 -479 -20002...
result:
ok ok Sum L = 4768
Test #9:
score: 0
Accepted
time: 1ms
memory: 3980kb
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 -200020301 9012 267 -965 -200019732 9036 -367 -951 -200020366 9050 417 -944 -200019582 9057 197 -923 -200019802 9078 481 -873 -200019518 9128 -126 -799 -200020125 9202 643 -779 -200019356 9222 913 -700 -200019086 9301 498 -636 -200019501 9365 150 -618 -200019849 9383 -882 -602 -2000...
result:
ok ok Sum L = 5000
Test #10:
score: -100
Wrong Answer
time: 1ms
memory: 3756kb
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 -200020001 9996 0 -5 -200019999 9996 1 -5 -200019998 9996 2 -5 -200019997 9996 -5 -4 -200020004 9997 -4 -4 -200020003 9997 -1 -4 -200020000 9997 0 -4 -200019999 9997 1 -4 -200019998 9997 5 -4 -200019994 9997 -5 -3 -200020004 9998 -4 -3 -200020003 9998 -3 -3 -200020002 9998 0 -3 -2000199...
result:
wrong answer Polyline 2 intersects with previous polylines.