QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#303965#7680. SubwayzhouhuanyiAC ✓1ms3860kbC++141.2kb2024-01-13 09:23:342024-01-13 09:23:34

Judging History

你现在查看的是最新测评结果

  • [2024-01-13 09:23:34]
  • 评测
  • 测评结果:AC
  • 用时:1ms
  • 内存:3860kb
  • [2024-01-13 09:23:34]
  • 提交

answer

#include<iostream>
#include<cstdio>
#include<algorithm>
#define N 100
using namespace std;
const int inf=(int)(1e7);
int read()
{
	char c=0;
	int sum=0,f=1;
	while (c!='-'&&(c<'0'||c>'9')) c=getchar();
	if (c=='-') c=getchar(),f=-1;
	while ('0'<=c&&c<='9') sum=sum*10+c-'0',c=getchar();
	return sum*f;
}
struct reads
{
	int x,y,a;
	bool operator < (const reads &t)const
	{
		return x!=t.x?x<t.x:y>t.y;	
	}
};
reads st[N+1];
struct points
{
	int x,y;
};
points tong[N+1];
int n,length,maxn;
int main()
{
	n=read();
	for (int i=1;i<=n;++i) st[i].x=read(),st[i].y=read(),st[i].a=read(),maxn=max(maxn,st[i].a);
	if (n==1)
	{
		printf("%d\n",st[1].a);
		for (int i=1;i<=st[1].a;++i) printf("2 %d %d %d %d\n",st[1].x,st[1].y,st[1].x+1,st[1].y+i);
	}
	else
	{
		sort(st+1,st+n+1),printf("%d\n",maxn);
		for (int i=1;i<=maxn;++i)
		{
			length=0;
			for (int j=1;j<=n;++j)
			{
				if (j!=1) tong[++length]=(points){i*(st[j-1].x+st[j].x+4000)-2000,i*(st[j-1].y+st[j].y+2*inf)-inf};
				if (st[j].a>=i) tong[++length]=(points){st[j].x,st[j].y};
			}
			printf("%d ",length);
			for (int j=1;j<=length;++j) printf("%d %d ",tong[j].x,tong[j].y);
			puts("");
		}
	}
	return 0;
}

这程序好像有点Bug,我给组数据试试?

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3772kb

input:

3
1 2 1
2 1 2
3 3 2

output:

2
5 1 2 2003 10000003 2 1 2005 10000004 3 3 
4 6006 30000006 2 1 6010 30000008 3 3 

result:

ok ok Sum L = 9

Test #2:

score: 0
Accepted
time: 0ms
memory: 3720kb

input:

1
1 1 1

output:

1
2 1 1 2 2

result:

ok ok Sum L = 2

Test #3:

score: 0
Accepted
time: 0ms
memory: 3728kb

input:

1
1 1 50

output:

50
2 1 1 2 2
2 1 1 2 3
2 1 1 2 4
2 1 1 2 5
2 1 1 2 6
2 1 1 2 7
2 1 1 2 8
2 1 1 2 9
2 1 1 2 10
2 1 1 2 11
2 1 1 2 12
2 1 1 2 13
2 1 1 2 14
2 1 1 2 15
2 1 1 2 16
2 1 1 2 17
2 1 1 2 18
2 1 1 2 19
2 1 1 2 20
2 1 1 2 21
2 1 1 2 22
2 1 1 2 23
2 1 1 2 24
2 1 1 2 25
2 1 1 2 26
2 1 1 2 27
2 1 1 2 28
2 1 1 2 ...

result:

ok ok Sum L = 100

Test #4:

score: 0
Accepted
time: 1ms
memory: 3796kb

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
99 -981 -193 74 10000189 -945 382 129 10001053 -926 671 186 10000004 -888 -667 227 9998558 -885 -775 245 9998528 -870 -697 305 9999684 -825 381 391 9999844 -784 -537 533 10000194 -683 731 649 10000006 -668 -725 753 9998838 -579 -437 863 10000388 -558 825 894 10000173 -548 -652 953 9999171 -499 -1...

result:

ok ok Sum L = 3643

Test #5:

score: 0
Accepted
time: 0ms
memory: 3856kb

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
99 -772 697 472 9999788 -756 -909 564 9999024 -680 -67 654 9999851 -666 -82 676 9999689 -658 -229 747 9999301 -595 -470 830 9999923 -575 393 852 10001006 -573 613 856 9999897 -571 -716 897 10000122 -532 838 938 10001728 -530 890 1004 10001087 -466 197 1145 10000905 -389 708 1265 10001166 -346 458 ...

result:

ok ok Sum L = 99

Test #6:

score: 0
Accepted
time: 0ms
memory: 3768kb

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
99 -999 330 28 10000430 -973 100 65 9999560 -962 -540 150 9998847 -888 -613 270 9999768 -842 381 366 9999756 -792 -625 571 9998574 -637 -801 748 9998524 -615 -675 824 9999023 -561 -302 887 9998732 -552 -966 904 9998983 -544 -51 973 10000205 -483 256 1045 10000300 -472 44 1164 10000213 -364 169 130...

result:

ok ok Sum L = 386

Test #7:

score: 0
Accepted
time: 0ms
memory: 3760kb

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
99 -982 -212 38 10000541 -980 753 48 10000441 -972 -312 135 9999484 -893 -204 294 9998875 -813 -921 382 9998775 -805 -304 428 9998722 -767 -974 486 9999842 -747 816 593 10000481 -660 -335 693 9999826 -647 161 726 10000766 -627 605 813 9999857 -560 -748 942 9998794 -498 -458 1083 10000106 -419 564...

result:

ok ok Sum L = 771

Test #8:

score: 0
Accepted
time: 0ms
memory: 3776kb

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
99 -998 343 44 9999832 -958 -511 130 9999955 -912 466 201 10000617 -887 151 245 10000037 -868 -114 346 9999502 -786 -384 465 9998985 -749 -631 514 9999463 -737 94 614 9999615 -649 -479 736 10000330 -615 809 797 10000671 -588 -138 897 9999322 -515 -540 991 9999817 -494 357 1020 10001223 -486 866 1...

result:

ok ok Sum L = 4718

Test #9:

score: 0
Accepted
time: 1ms
memory: 3768kb

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
99 -882 -602 267 9999677 -851 279 303 10001008 -846 729 313 10001330 -841 601 555 10000433 -604 -168 825 9999936 -571 104 885 10000411 -544 307 941 10001282 -515 975 984 10001902 -501 927 1025 10001707 -474 780 1157 10000682 -369 -98 1264 9998951 -367 -951 1298 9999105 -335 56 1341 10000506 -324 ...

result:

ok ok Sum L = 4950

Test #10:

score: 0
Accepted
time: 1ms
memory: 3792kb

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
99 -5 1 1990 10000001 -5 0 1990 9999997 -5 -3 1990 9999993 -5 -4 1991 9999997 -4 1 1992 9999998 -4 -3 1992 9999993 -4 -4 1993 10000001 -3 5 1994 10000008 -3 3 1994 10000004 -3 1 1994 10000001 -3 0 1994 9999999 -3 -1 1994 9999997 -3 -2 1994 9999995 -3 -3 1995 10000002 -2 5 1996 10000007 -2 2 1996 ...

result:

ok ok Sum L = 3874

Test #11:

score: 0
Accepted
time: 0ms
memory: 3796kb

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
99 -5 5 1990 10000006 -5 1 1990 10000000 -5 -1 1990 9999996 -5 -3 1990 9999992 -5 -5 1991 10000000 -4 5 1992 10000009 -4 4 1992 10000005 -4 1 1992 9999997 -4 -4 1993 10000001 -3 5 1994 10000007 -3 2 1994 10000002 -3 0 1994 9999998 -3 -2 1994 9999995 -3 -3 1994 9999993 -3 -4 1995 10000001 -2 5 1996...

result:

ok ok Sum L = 184

Test #12:

score: 0
Accepted
time: 1ms
memory: 3772kb

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
99 -5 5 1990 10000009 -5 4 1990 10000003 -5 -1 1990 9999996 -5 -3 1990 9999992 -5 -5 1991 9999999 -4 4 1992 10000005 -4 1 1992 9999996 -4 -5 1993 10000000 -3 5 1994 10000004 -3 -1 1994 9999995 -3 -4 1994 9999991 -3 -5 1995 9999998 -2 3 1996 10000003 -2 0 1996 9999997 -2 -3 1996 9999993 -2 -4 1997...

result:

ok ok Sum L = 4927

Test #13:

score: 0
Accepted
time: 1ms
memory: 3808kb

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
99 114 514 2229 10001028 115 514 2231 10001028 116 514 2233 10001028 117 514 2235 10001028 118 514 2237 10001028 119 514 2239 10001028 120 514 2241 10001028 121 514 2243 10001028 122 514 2245 10001028 123 514 2247 10001028 124 514 2249 10001028 125 514 2251 10001028 126 514 2253 10001028 127 514 ...

result:

ok ok Sum L = 3553

Test #14:

score: 0
Accepted
time: 1ms
memory: 3732kb

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
99 191 981 2382 10001961 191 980 2382 10001959 191 979 2382 10001957 191 978 2382 10001955 191 977 2382 10001953 191 976 2382 10001951 191 975 2382 10001949 191 974 2382 10001947 191 973 2382 10001945 191 972 2382 10001943 191 971 2382 10001941 191 970 2382 10001939 191 969 2382 10001937 191 968 ...

result:

ok ok Sum L = 3553

Test #15:

score: 0
Accepted
time: 1ms
memory: 3860kb

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
99 -123 456 1755 10000913 -122 457 1757 10000915 -121 458 1759 10000917 -120 459 1761 10000919 -119 460 1763 10000921 -118 461 1765 10000923 -117 462 1767 10000925 -116 463 1769 10000927 -115 464 1771 10000929 -114 465 1773 10000931 -113 466 1775 10000933 -112 467 1777 10000935 -111 468 1779 1000...

result:

ok ok Sum L = 3656

Test #16:

score: 0
Accepted
time: 1ms
memory: 3728kb

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
99 321 -525 2643 9998949 322 -526 2645 9998947 323 -527 2647 9998945 324 -528 2649 9998943 325 -529 2651 9998941 326 -530 2653 9998939 327 -531 2655 9998937 328 -532 2657 9998935 329 -533 2659 9998933 330 -534 2661 9998931 331 -535 2663 9998929 332 -536 2665 9998927 333 -537 2667 9998925 334 -538...

result:

ok ok Sum L = 3662

Test #17:

score: 0
Accepted
time: 1ms
memory: 3784kb

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
99 -493 -604 1015 9998793 -492 -603 1017 9998795 -491 -602 1019 9998797 -490 -601 1021 9998799 -489 -600 1023 9998801 -488 -599 1025 9998803 -487 -598 1027 9998805 -486 -597 1029 9998807 -485 -596 1031 9998809 -484 -595 1033 9998811 -483 -594 1035 9998813 -482 -593 1037 9998815 -481 -592 1039 999...

result:

ok ok Sum L = 3611

Test #18:

score: 0
Accepted
time: 1ms
memory: 3724kb

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
99 -191 49 1619 10000097 -190 48 1621 10000095 -189 47 1623 10000093 -188 46 1625 10000091 -187 45 1627 10000089 -186 44 1629 10000087 -185 43 1631 10000085 -184 42 1633 10000083 -183 41 1635 10000081 -182 40 1637 10000079 -181 39 1639 10000077 -180 38 1641 10000075 -179 37 1643 10000073 -178 36 ...

result:

ok ok Sum L = 3761

Test #19:

score: 0
Accepted
time: 1ms
memory: 3760kb

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
23 -1000 1000 0 10001999 -1000 999 0 10000000 -1000 -999 0 9998001 -1000 -1000 1 10000000 -999 1000 2 10000000 -999 -1000 2000 10000000 999 1000 3998 10000000 999 -1000 3999 10000000 1000 1000 4000 10001999 1000 999 4000 10000000 1000 -999 4000 9998001 1000 -1000 
23 -1000 1000 2000 30003998 -100...

result:

ok ok Sum L = 1150

Test #20:

score: 0
Accepted
time: 0ms
memory: 3764kb

input:

4
1000 1000 50
1000 -1000 50
-1000 1000 50
-1000 -1000 50

output:

50
7 -1000 1000 0 10000000 -1000 -1000 2000 10000000 1000 1000 4000 10000000 1000 -1000 
7 -1000 1000 2000 30000000 -1000 -1000 6000 30000000 1000 1000 10000 30000000 1000 -1000 
7 -1000 1000 4000 50000000 -1000 -1000 10000 50000000 1000 1000 16000 50000000 1000 -1000 
7 -1000 1000 6000 70000000 -10...

result:

ok ok Sum L = 350

Extra Test:

score: 0
Extra Test Passed