QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#625556#7680. Subwaylmx111AC ✓1ms3884kbC++20783b2024-10-09 19:51:082024-10-09 19:51:08

Judging History

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

  • [2024-10-09 19:51:08]
  • 评测
  • 测评结果:AC
  • 用时:1ms
  • 内存:3884kb
  • [2024-10-09 19:51:08]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
const int B = 10001, hf = 5001;
int main(){
	int n;
	cin >> n;
	vector<tuple<int, int, int>> a(n + 5);
	int maxa = 0;
	for (int i = 1; i <= n; i++){
		int x, y, c;
		cin >> x >> y >> c;
		maxa = max(maxa, c);
		a[i] = { x,y,c };
	}
	sort(a.begin() + 1, a.begin() + n + 1);
	vector<vector<pair<int, int>>> lines(maxa);
	for (int k = 0; k < maxa; k++){
		for (int i = 1; i <= n; i++){
			auto [x, y, c] = a[i];
			if (k < c){
				lines[k].emplace_back(x, y);
			}
			lines[k].emplace_back(x - 1 - k * 2, y + hf + k * B);
		}
	}
	cout << lines.size() << endl;
	for (auto& line : lines){
		cout << line.size();
		for (auto [x, y] : line) {
			cout << ' ' << x << ' ' << y;
		}
		cout << endl;
	}
	return 0;
}

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

詳細信息

Test #1:

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

input:

3
1 2 1
2 1 2
3 3 2

output:

2
6 1 2 0 5003 2 1 1 5002 3 3 2 5004
5 -2 15004 2 1 -1 15003 3 3 0 15005

result:

ok ok Sum L = 11

Test #2:

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

input:

1
1 1 1

output:

1
2 1 1 0 5002

result:

ok ok Sum L = 2

Test #3:

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

input:

1
1 1 50

output:

50
2 1 1 0 5002
2 1 1 -2 15003
2 1 1 -4 25004
2 1 1 -6 35005
2 1 1 -8 45006
2 1 1 -10 55007
2 1 1 -12 65008
2 1 1 -14 75009
2 1 1 -16 85010
2 1 1 -18 95011
2 1 1 -20 105012
2 1 1 -22 115013
2 1 1 -24 125014
2 1 1 -26 135015
2 1 1 -28 145016
2 1 1 -30 155017
2 1 1 -32 165018
2 1 1 -34 175019
2 1 1 -3...

result:

ok ok Sum L = 100

Test #4:

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

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 -981 -193 -982 4808 -945 382 -946 5383 -926 671 -927 5672 -888 -667 -889 4334 -885 -775 -886 4226 -870 -697 -871 4304 -825 381 -826 5382 -784 -537 -785 4464 -683 731 -684 5732 -668 -725 -669 4276 -579 -437 -580 4564 -558 825 -559 5826 -548 -652 -549 4349 -499 -177 -500 4824 -469 -256 -470 474...

result:

ok ok Sum L = 3693

Test #5:

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

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 -772 697 -773 5698 -756 -909 -757 4092 -680 -67 -681 4934 -666 -82 -667 4919 -658 -229 -659 4772 -595 -470 -596 4531 -575 393 -576 5394 -573 613 -574 5614 -571 -716 -572 4285 -532 838 -533 5839 -530 890 -531 5891 -466 197 -467 5198 -389 708 -390 5709 -346 458 -347 5459 -304 897 -305 5898 -273 ...

result:

ok ok Sum L = 100

Test #6:

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

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 -999 330 -1000 5331 -973 100 -974 5101 -962 -540 -963 4461 -888 -613 -889 4388 -842 381 -843 5382 -792 -625 -793 4376 -637 -801 -638 4200 -615 -675 -616 4326 -561 -302 -562 4699 -552 -966 -553 4035 -544 -51 -545 4950 -483 256 -484 5257 -472 44 -473 5045 -364 169 -365 5170 -334 -535 -335 4466 -...

result:

ok ok Sum L = 391

Test #7:

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

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 -982 -212 -983 4789 -980 753 -981 5754 -972 -312 -973 4689 -893 -204 -894 4797 -813 -921 -814 4080 -805 -304 -806 4697 -767 -974 -768 4027 -747 816 -748 5817 -660 -335 -661 4666 -647 161 -648 5162 -627 605 -628 5606 -560 -748 -561 4253 -498 -458 -499 4543 -419 564 -420 5565 -397 -741 -398 426...

result:

ok ok Sum L = 781

Test #8:

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

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 -998 343 -999 5344 -958 -511 -959 4490 -912 466 -913 5467 -887 151 -888 5152 -868 -114 -869 4887 -786 -384 -787 4617 -749 -631 -750 4370 -737 94 -738 5095 -649 -479 -650 4522 -615 809 -616 5810 -588 -138 -589 4863 -515 -540 -516 4461 -494 357 -495 5358 -486 866 -487 5867 -367 -178 -368 4823 -...

result:

ok ok Sum L = 4768

Test #9:

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

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 -882 -602 -883 4399 -851 279 -852 5280 -846 729 -847 5730 -841 601 -842 5602 -604 -168 -605 4833 -571 104 -572 5105 -544 307 -545 5308 -515 975 -516 5976 -501 927 -502 5928 -474 780 -475 5781 -369 -98 -370 4903 -367 -951 -368 4050 -335 56 -336 5057 -324 450 -325 5451 -302 -989 -303 4012 -193 ...

result:

ok ok Sum L = 5000

Test #10:

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

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 -5 -4 -6 4997 -5 -3 -6 4998 -5 0 -6 5001 -5 1 -6 5002 -4 -4 -5 4997 -4 -3 -5 4998 -4 1 -5 5002 -3 -3 -4 4998 -3 -2 -4 4999 -3 -1 -4 5000 -3 0 -4 5001 -3 1 -4 5002 -3 3 -4 5004 -3 5 -4 5006 -2 -5 -3 4996 -2 -1 -3 5000 -2 2 -3 5003 -2 5 -3 5006 -1 -4 -2 4997 -1 3 -2 5004 -1 4 -2 5005 -1 5 -2 50...

result:

ok ok Sum L = 3924

Test #11:

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

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 -6 4996 -5 -3 -6 4998 -5 -1 -6 5000 -5 1 -6 5002 -5 5 -6 5006 -4 -4 -5 4997 -4 1 -5 5002 -4 4 -5 5005 -4 5 -5 5006 -3 -4 -4 4997 -3 -3 -4 4998 -3 -2 -4 4999 -3 0 -4 5001 -3 2 -4 5003 -3 5 -4 5006 -2 -4 -3 4997 -2 -2 -3 4999 -2 -1 -3 5000 -2 1 -3 5002 -2 2 -3 5003 -2 4 -3 5005 -2 5 -3 500...

result:

ok ok Sum L = 186

Test #12:

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

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 -6 4996 -5 -3 -6 4998 -5 -1 -6 5000 -5 4 -6 5005 -5 5 -6 5006 -4 -5 -5 4996 -4 1 -5 5002 -4 4 -5 5005 -3 -5 -4 4996 -3 -4 -4 4997 -3 -1 -4 5000 -3 5 -4 5006 -2 -4 -3 4997 -2 -3 -3 4998 -2 0 -3 5001 -2 3 -3 5004 -1 -5 -2 4996 -1 -4 -2 4997 -1 -2 -2 4999 -1 -1 -2 5000 -1 0 -2 5001 -1 1 -2...

result:

ok ok Sum L = 4977

Test #13:

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

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 113 5515 115 514 114 5515 116 514 115 5515 117 514 116 5515 118 514 117 5515 119 514 118 5515 120 514 119 5515 121 514 120 5515 122 514 121 5515 123 514 122 5515 124 514 123 5515 125 514 124 5515 126 514 125 5515 127 514 126 5515 128 514 127 5515 129 514 128 5515 130 514 129 5515 131 ...

result:

ok ok Sum L = 3602

Test #14:

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

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 190 5933 191 933 190 5934 191 934 190 5935 191 935 190 5936 191 936 190 5937 191 937 190 5938 191 938 190 5939 191 939 190 5940 191 940 190 5941 191 941 190 5942 191 942 190 5943 191 943 190 5944 191 944 190 5945 191 945 190 5946 191 946 190 5947 191 947 190 5948 191 948 190 5949 191 ...

result:

ok ok Sum L = 3602

Test #15:

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

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 -124 5457 -122 457 -123 5458 -121 458 -122 5459 -120 459 -121 5460 -119 460 -120 5461 -118 461 -119 5462 -117 462 -118 5463 -116 463 -117 5464 -115 464 -116 5465 -114 465 -115 5466 -113 466 -114 5467 -112 467 -113 5468 -111 468 -112 5469 -110 469 -111 5470 -109 470 -110 5471 -108 471...

result:

ok ok Sum L = 3706

Test #16:

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

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 321 -525 320 4476 322 -526 321 4475 323 -527 322 4474 324 -528 323 4473 325 -529 324 4472 326 -530 325 4471 327 -531 326 4470 328 -532 327 4469 329 -533 328 4468 330 -534 329 4467 331 -535 330 4466 332 -536 331 4465 333 -537 332 4464 334 -538 333 4463 335 -539 334 4462 336 -540 335 4461 337 -...

result:

ok ok Sum L = 3712

Test #17:

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

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 -494 4397 -492 -603 -493 4398 -491 -602 -492 4399 -490 -601 -491 4400 -489 -600 -490 4401 -488 -599 -489 4402 -487 -598 -488 4403 -486 -597 -487 4404 -485 -596 -486 4405 -484 -595 -485 4406 -483 -594 -484 4407 -482 -593 -483 4408 -481 -592 -482 4409 -480 -591 -481 4410 -479 -590 -48...

result:

ok ok Sum L = 3661

Test #18:

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

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 -191 49 -192 5050 -190 48 -191 5049 -189 47 -190 5048 -188 46 -189 5047 -187 45 -188 5046 -186 44 -187 5045 -185 43 -186 5044 -184 42 -185 5043 -183 41 -184 5042 -182 40 -183 5041 -181 39 -182 5040 -180 38 -181 5039 -179 37 -180 5038 -178 36 -179 5037 -177 35 -178 5036 -176 34 -177 5035 -175 ...

result:

ok ok Sum L = 3811

Test #19:

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

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 -1001 4001 -1000 -999 -1001 4002 -1000 999 -1001 6000 -1000 1000 -1001 6001 -999 -1000 -1000 4001 -999 1000 -1000 6001 999 -1000 998 4001 999 1000 998 6001 1000 -1000 999 4001 1000 -999 999 4002 1000 999 999 6000 1000 1000 999 6001
24 -1000 -1000 -1003 14002 -1000 -999 -1003 14003 ...

result:

ok ok Sum L = 1200

Test #20:

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

input:

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

output:

50
8 -1000 -1000 -1001 4001 -1000 1000 -1001 6001 1000 -1000 999 4001 1000 1000 999 6001
8 -1000 -1000 -1003 14002 -1000 1000 -1003 16002 1000 -1000 997 14002 1000 1000 997 16002
8 -1000 -1000 -1005 24003 -1000 1000 -1005 26003 1000 -1000 995 24003 1000 1000 995 26003
8 -1000 -1000 -1007 34004 -1000...

result:

ok ok Sum L = 400

Extra Test:

score: 0
Extra Test Passed