QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#409544#7680. Subwaylight_ink_dotsWA 1ms3976kbC++141.1kb2024-05-12 11:02:112024-05-12 11:02:12

Judging History

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

  • [2024-05-12 11:02:12]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3976kb
  • [2024-05-12 11:02:11]
  • 提交

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 , dy = (B + l)*2;
        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;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3756kb

input:

3
1 2 1
2 1 2
3 3 2

output:

2
6 2 1 -100024998 10003 1 2 -100024999 10004 3 3 -100024997 10005
5 2 1 -100044999 10005 -100045000 10006 3 3 -100044998 10007

result:

ok ok Sum L = 11

Test #2:

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

input:

1
1 1 1

output:

1
2 1 1 -100024999 10003

result:

ok ok Sum L = 2

Test #3:

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

input:

1
1 1 50

output:

50
2 1 1 -100024999 10003
2 1 1 -100045000 10005
2 1 1 -100065001 10007
2 1 1 -100085002 10009
2 1 1 -100105003 10011
2 1 1 -100125004 10013
2 1 1 -100145005 10015
2 1 1 -100165006 10017
2 1 1 -100185007 10019
2 1 1 -100205008 10021
2 1 1 -100225009 10023
2 1 1 -100245010 10025
2 1 1 -100265011 1002...

result:

ok ok Sum L = 100

Test #4:

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

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 -100024039 9083 -306 -897 -100025306 9105 334 -893 -100024666 9109 -371 -812 -100025371 9190 -885 -775 -100025885 9227 -668 -725 -100025668 9277 -462 -719 -100025462 9283 202 -702 -100024798 9300 -870 -697 -100025870 9305 -888 -667 -100025888 9335 -548 -652 -100025548 9350 662 -567 -...

result:

ok ok Sum L = 3693

Test #5:

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

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 -100025162 9043 -756 -909 -100025756 9093 -192 -890 -100025192 9112 30 -869 -100024970 9133 -197 -795 -100025197 9207 749 -723 -100024251 9279 -571 -716 -100025571 9286 -216 -711 -100025216 9291 -273 -672 -100025273 9330 473 -639 -100024527 9363 333 -637 -100024667 9365 360 -630 -100...

result:

ok ok Sum L = 100

Test #6:

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

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 -100024644 9016 348 -975 -100024652 9027 -552 -966 -100025552 9036 618 -911 -100024382 9091 846 -893 -100024154 9109 594 -847 -100024406 9155 674 -804 -100024326 9198 -637 -801 -100025637 9201 871 -799 -100024129 9203 17 -757 -100024983 9245 -615 -675 -100025615 9327 840 -638 -1000241...

result:

ok ok Sum L = 391

Test #7:

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

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 -100025313 9006 -285 -980 -100025285 9022 -767 -974 -100025767 9028 932 -941 -100024068 9061 -258 -938 -100025258 9064 -813 -921 -100025813 9081 -325 -875 -100025325 9127 -19 -845 -100025019 9157 166 -766 -100024834 9236 -560 -748 -100025560 9254 -397 -741 -100025397 9261 -189 -728 ...

result:

ok ok Sum L = 781

Test #8:

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

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 -100024925 9044 -282 -917 -100025282 9085 24 -889 -100024976 9113 173 -857 -100024827 9145 273 -830 -100024727 9172 808 -695 -100024192 9307 537 -637 -100024463 9365 -749 -631 -100025749 9371 938 -596 -100024062 9406 -515 -540 -100025515 9462 -958 -511 -100025958 9491 -649 -479 -10002...

result:

ok ok Sum L = 4768

Test #9:

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

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 -100025302 9013 267 -965 -100024733 9037 -367 -951 -100025367 9051 417 -944 -100024583 9058 197 -923 -100024803 9079 481 -873 -100024519 9129 -126 -799 -100025126 9203 643 -779 -100024357 9223 913 -700 -100024087 9302 498 -636 -100024502 9366 150 -618 -100024850 9384 -882 -602 -1000...

result:

ok ok Sum L = 5000

Test #10:

score: -100
Wrong Answer
time: 1ms
memory: 3716kb

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 -100025002 9997 0 -5 -100025000 9997 1 -5 -100024999 9997 2 -5 -100024998 9997 -5 -4 -100025005 9998 -4 -4 -100025004 9998 -1 -4 -100025001 9998 0 -4 -100025000 9998 1 -4 -100024999 9998 5 -4 -100024995 9998 -5 -3 -100025005 9999 -4 -3 -100025004 9999 -3 -3 -100025003 9999 0 -3 -1000250...

result:

wrong answer Polyline 2 intersects with previous polylines.