QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#409110#7680. Subwaylight_ink_dots#WA 1ms4108kbC++14948b2024-05-11 19:00:432024-05-11 19:00:43

Judging History

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

  • [2024-05-11 19:00:43]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:4108kb
  • [2024-05-11 19:00:43]
  • 提交

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];
    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);
    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);
    for (int l = mx; l; l--) {
        int dx = (1 - 2 * (B + l)) * B - 1000, dy = B + l;
        vector<pair<int, int>> ans;
        for (int i = 1; i <= n; 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);
        }
        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: 0ms
memory: 3876kb

input:

3
1 2 1
2 1 2
3 3 2

output:

2
5 2 1 -200030998 10003 -200030999 10004 3 3 -200030997 10005
6 2 1 -200010998 10002 1 2 -200010999 10003 3 3 -200010997 10004

result:

ok ok Sum L = 11

Test #2:

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

input:

1
1 1 1

output:

1
2 1 1 -200010999 10002

result:

ok ok Sum L = 2

Test #3:

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

input:

1
1 1 50

output:

50
2 1 1 -200990999 10051
2 1 1 -200970999 10050
2 1 1 -200950999 10049
2 1 1 -200930999 10048
2 1 1 -200910999 10047
2 1 1 -200890999 10046
2 1 1 -200870999 10045
2 1 1 -200850999 10044
2 1 1 -200830999 10043
2 1 1 -200810999 10042
2 1 1 -200790999 10041
2 1 1 -200770999 10040
2 1 1 -200750999 1003...

result:

ok ok Sum L = 100

Test #4:

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

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 -200990039 9131 -200991306 9153 -200990666 9157 -200991371 9238 -200991885 9275 -200991668 9325 -200991462 9331 -200990798 9348 -870 -697 -200991870 9353 -200991888 9383 -200991548 9398 -200990338 9483 -200990264 9499 -200991784 9513 -200991579 9613 -200990652 9728 -200990383 9745 -3 -296 -200...

result:

wrong answer Polyline 23 intersects with previous polylines.