QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#603073#7680. SubwayetherealUnicornAC ✓1ms3712kbC++141.3kb2024-10-01 14:33:362024-10-01 14:33:37

Judging History

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

  • [2024-10-01 14:33:37]
  • 评测
  • 测评结果:AC
  • 用时:1ms
  • 内存:3712kb
  • [2024-10-01 14:33:36]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;

const int N = 53;
const int nx = 10001;
const int ny = 2;

struct Station
{
    int x, y;
    int cnt;
    int prex, prey;
};

Station st[N];

bool cmp(Station a, Station b) { return make_pair(a.x, a.y) < make_pair(b.x, b.y); }

int main()
{
    ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
    int n, maxcnt = 0, cntmax;
    cin >> n;
    for (int i = 1; i <= n; i++)
    {
        cin >> st[i].x >> st[i].y >> st[i].cnt;
        st[i].prex = st[i].x + 1 + ny * N;
        st[i].prey = st[i].y - (nx / ny + 1) - nx * N;
        maxcnt = max(maxcnt, st[i].cnt);
    }
    sort(st + 1, st + n + 1, cmp);
    cout << maxcnt << endl;
    for (; maxcnt > 0; maxcnt--)
    {
        cntmax = 0;
        for (int i = 1; i <= n; i++)
            if (st[i].cnt == maxcnt)
                cntmax++;
        cout << n + cntmax << " ";
        for (int i = 1; i <= n; i++)
        {
            cout << st[i].prex << " " << st[i].prey << " ";
            st[i].prex -= ny;
            st[i].prey += nx;
            if (st[i].cnt == maxcnt)
            {
                cout << st[i].x << " " << st[i].y << " ";
                st[i].cnt--;
            }
        }
        cout << endl;
    }
    return 0;
}

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

詳細信息

Test #1:

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

input:

3
1 2 1
2 1 2
3 3 2

output:

2
5 108 -535052 109 -535053 2 1 110 -535051 3 3 
6 106 -525051 1 2 107 -525052 2 1 108 -525050 3 3 

result:

ok ok Sum L = 11

Test #2:

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

input:

1
1 1 1

output:

1
2 108 -535053 1 1 

result:

ok ok Sum L = 2

Test #3:

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

input:

1
1 1 50

output:

50
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 80 -395039 1 1 
2 78 -385038 1 1 
2 76...

result:

ok ok Sum L = 100

Test #4:

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

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 -874 -535247 -838 -534672 -819 -534383 -781 -535721 -778 -535829 -763 -535751 -870 -697 -718 -534673 -677 -535591 -576 -534323 -561 -535779 -472 -535491 -451 -534229 -441 -535706 -392 -535231 -362 -535310 -355 -535773 -342 -534598 -264 -535866 -224 -534878 -199 -535951 -98 -535119 -75 -534244 ...

result:

ok ok Sum L = 3693

Test #5:

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

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 -665 -534357 -772 697 -649 -535963 -756 -909 -573 -535121 -680 -67 -559 -535136 -666 -82 -551 -535283 -658 -229 -488 -535524 -595 -470 -468 -534661 -575 393 -466 -534441 -573 613 -464 -535770 -571 -716 -425 -534216 -532 838 -423 -534164 -530 890 -359 -534857 -466 197 -282 -534346 -389 708 -239...

result:

ok ok Sum L = 100

Test #6:

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

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 -892 -534724 -866 -534954 -973 100 -855 -535594 -781 -535667 -735 -534673 -685 -535679 -530 -535855 -508 -535729 -454 -535356 -445 -536020 -437 -535105 -376 -534798 -365 -535010 -257 -534885 -227 -535589 -191 -535384 -186 -534387 -126 -535486 -233 -432 -52 -534445 3 -534082 51 -534307 60 -53466...

result:

ok ok Sum L = 391

Test #7:

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

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 -875 -535266 -873 -534301 -865 -535366 -786 -535258 -706 -535975 -698 -535358 -660 -536028 -767 -974 -640 -534238 -747 816 -553 -535389 -540 -534893 -520 -534449 -453 -535802 -391 -535512 -312 -534490 -290 -535795 -242 -535217 -218 -535929 -217 -534238 -206 -536050 -178 -536034 -171 -535652 -1...

result:

ok ok Sum L = 781

Test #8:

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

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 -891 -534711 -851 -535565 -805 -534588 -912 466 -780 -534903 -761 -535168 -868 -114 -679 -535438 -642 -535685 -630 -534960 -542 -535533 -508 -534245 -481 -535192 -408 -535594 -387 -534697 -379 -534188 -260 -535232 -201 -534402 -182 -534986 -180 -535339 -175 -535971 -161 -535093 -105 -535028 -2...

result:

ok ok Sum L = 4768

Test #9:

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

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 -775 -535656 -882 -602 -744 -534775 -851 279 -739 -534325 -846 729 -734 -534453 -841 601 -497 -535222 -604 -168 -464 -534950 -571 104 -437 -534747 -544 307 -408 -534079 -515 975 -394 -534127 -501 927 -367 -534274 -474 780 -262 -535152 -369 -98 -260 -536005 -367 -951 -228 -534998 -335 56 -217 ...

result:

ok ok Sum L = 5000

Test #10:

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

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 102 -535058 102 -535057 102 -535054 102 -535053 103 -535058 103 -535057 103 -535053 104 -535057 104 -535056 104 -535055 104 -535054 104 -535053 104 -535051 104 -535049 105 -535059 105 -535055 105 -535052 105 -535049 106 -535058 106 -535051 106 -535050 106 -535049 107 -535059 107 -535058 107 -5...

result:

ok ok Sum L = 3924

Test #11:

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

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 102 -535059 -5 -5 102 -535057 -5 -3 102 -535055 -5 -1 102 -535053 -5 1 102 -535049 -5 5 103 -535058 -4 -4 103 -535053 -4 1 103 -535050 103 -535049 -4 5 104 -535058 -3 -4 104 -535057 -3 -3 104 -535056 -3 -2 104 -535054 -3 0 104 -535052 104 -535049 105 -535058 105 -535056 -2 -2 105 -535055 -2 -1 ...

result:

ok ok Sum L = 186

Test #12:

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

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 102 -535059 -5 -5 102 -535057 102 -535055 -5 -1 102 -535050 -5 4 102 -535049 103 -535059 -4 -5 103 -535053 -4 1 103 -535050 -4 4 104 -535059 -3 -5 104 -535058 104 -535055 104 -535049 105 -535058 105 -535057 -2 -3 105 -535054 105 -535051 -2 3 106 -535059 -1 -5 106 -535058 106 -535056 106 -53505...

result:

ok ok Sum L = 4977

Test #13:

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

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 221 -534540 222 -534540 223 -534540 224 -534540 117 514 225 -534540 226 -534540 119 514 227 -534540 228 -534540 229 -534540 230 -534540 231 -534540 232 -534540 233 -534540 234 -534540 235 -534540 236 -534540 237 -534540 130 514 238 -534540 239 -534540 240 -534540 241 -534540 242 -534540 243 -5...

result:

ok ok Sum L = 3602

Test #14:

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

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 298 -534122 298 -534121 298 -534120 298 -534119 298 -534118 298 -534117 298 -534116 298 -534115 298 -534114 298 -534113 298 -534112 298 -534111 298 -534110 298 -534109 298 -534108 298 -534107 298 -534106 298 -534105 298 -534104 298 -534103 298 -534102 298 -534101 298 -534100 298 -534099 298 -5...

result:

ok ok Sum L = 3602

Test #15:

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

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 -16 -534598 -15 -534597 -14 -534596 -13 -534595 -12 -534594 -11 -534593 -10 -534592 -9 -534591 -8 -534590 -7 -534589 -6 -534588 -5 -534587 -4 -534586 -3 -534585 -2 -534584 -1 -534583 0 -534582 1 -534581 2 -534580 3 -534579 4 -534578 5 -534577 6 -534576 7 -534575 8 -534574 9 -534573 10 -534572 ...

result:

ok ok Sum L = 3706

Test #16:

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

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 428 -535579 429 -535580 430 -535581 431 -535582 432 -535583 433 -535584 434 -535585 435 -535586 436 -535587 437 -535588 438 -535589 439 -535590 440 -535591 441 -535592 442 -535593 443 -535594 444 -535595 445 -535596 446 -535597 447 -535598 448 -535599 449 -535600 450 -535601 451 -535602 452 -5...

result:

ok ok Sum L = 3712

Test #17:

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

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 -386 -535658 -385 -535657 -384 -535656 -383 -535655 -382 -535654 -381 -535653 -488 -599 -380 -535652 -379 -535651 -378 -535650 -377 -535649 -376 -535648 -375 -535647 -374 -535646 -373 -535645 -372 -535644 -371 -535643 -370 -535642 -369 -535641 -368 -535640 -367 -535639 -366 -535638 -365 -53563...

result:

ok ok Sum L = 3661

Test #18:

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

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 -84 -535005 -83 -535006 -82 -535007 -189 47 -81 -535008 -80 -535009 -79 -535010 -78 -535011 -77 -535012 -76 -535013 -75 -535014 -74 -535015 -73 -535016 -72 -535017 -71 -535018 -70 -535019 -69 -535020 -68 -535021 -67 -535022 -66 -535023 -65 -535024 -64 -535025 -63 -535026 -62 -535027 -61 -53502...

result:

ok ok Sum L = 3811

Test #19:

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

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 -893 -536054 -1000 -1000 -893 -536053 -1000 -999 -893 -534055 -1000 999 -893 -534054 -1000 1000 -892 -536054 -999 -1000 -892 -534054 -999 1000 1106 -536054 999 -1000 1106 -534054 999 1000 1107 -536054 1000 -1000 1107 -536053 1000 -999 1107 -534055 1000 999 1107 -534054 1000 1000 
24 -895 -5260...

result:

ok ok Sum L = 1200

Test #20:

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

input:

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

output:

50
8 -893 -536054 -1000 -1000 -893 -534054 -1000 1000 1107 -536054 1000 -1000 1107 -534054 1000 1000 
8 -895 -526053 -1000 -1000 -895 -524053 -1000 1000 1105 -526053 1000 -1000 1105 -524053 1000 1000 
8 -897 -516052 -1000 -1000 -897 -514052 -1000 1000 1103 -516052 1000 -1000 1103 -514052 1000 1000 
...

result:

ok ok Sum L = 400

Extra Test:

score: 0
Extra Test Passed