QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#409533#7680. Subwaylight_ink_dotsWA 0ms3988kbC++141010b2024-05-12 10:57:102024-05-12 10:57:10

Judging History

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

  • [2024-05-12 10:57:10]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3988kb
  • [2024-05-12 10:57:10]
  • 提交

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 - (l << 1 | 1) * (B + 1), dy = 1 - (l << 1);
        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: 0
Wrong Answer
time: 0ms
memory: 3988kb

input:

3
1 2 1
2 1 2
3 3 2

output:

2
6 2 1 -3000 0 1 2 -3001 1 3 3 -2999 2
5 2 1 -5002 -2 -5003 -1 3 3 -5001 0

result:

wrong answer Polyline 2 intersects with previous polylines.