QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#409522#7680. Subwaylight_ink_dotsWA 1ms3988kbC++14988b2024-05-12 10:44:152024-05-12 10:44:16

Judging History

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

  • [2024-05-12 10:44:16]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3988kb
  • [2024-05-12 10:44:15]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;

int main() {
    static const int maxn = 60, B = 1000;
    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.y != y.y ? x.y < y.y : x.x < y.x; });
    printf("%d\n", mx);
    for (int i = 1; i <= n; i++) p[i].a = n == 50 ? mx : p[i].a;
    for (int l = 1; l <= mx; l++) {
        int dx = (1 - 2 * l) * B, dy = 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: 3748kb

input:

3
1 2 1
2 1 2
3 3 2

output:

2
6 2 1 -998 2 1 2 -999 3 3 3 -997 4
5 2 1 -2998 3 -2999 4 3 3 -2997 5

result:

ok ok Sum L = 11

Test #2:

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

input:

1
1 1 1

output:

1
2 1 1 -999 2

result:

ok ok Sum L = 2

Test #3:

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

input:

1
1 1 50

output:

50
2 1 1 -999 2
2 1 1 -2999 3
2 1 1 -4999 4
2 1 1 -6999 5
2 1 1 -8999 6
2 1 1 -10999 7
2 1 1 -12999 8
2 1 1 -14999 9
2 1 1 -16999 10
2 1 1 -18999 11
2 1 1 -20999 12
2 1 1 -22999 13
2 1 1 -24999 14
2 1 1 -26999 15
2 1 1 -28999 16
2 1 1 -30999 17
2 1 1 -32999 18
2 1 1 -34999 19
2 1 1 -36999 20
2 1 1 -...

result:

ok ok Sum L = 100

Test #4:

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

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 -39 -918 -306 -897 -1306 -896 334 -893 -666 -892 -371 -812 -1371 -811 -885 -775 -1885 -774 -668 -725 -1668 -724 -462 -719 -1462 -718 202 -702 -798 -701 -870 -697 -1870 -696 -888 -667 -1888 -666 -548 -652 -1548 -651 662 -567 -338 -566 736 -551 -264 -550 -784 -537 -1784 -536 -579 -437 ...

result:

wrong answer Polyline 2 intersects with previous polylines.