QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#409550#7680. Subwaylight_ink_dotsWA 0ms3896kbC++141.1kb2024-05-12 11:07:242024-05-12 11:07:25

Judging History

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

  • [2024-05-12 11:07:25]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3896kb
  • [2024-05-12 11:07:24]
  • 提交

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

input:

3
1 2 1
2 1 2
3 3 2

output:

2
6 2 1 -99994998 10002 1 2 -99994999 10003 3 3 -99994997 10004
5 2 1 -100014999 10004 -100015000 10005 3 3 -100014998 10006

result:

wrong answer Polyline 2 intersects with previous polylines.