QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#409266#7680. Subwaylight_ink_dotsWA 1ms3808kbC++141.5kb2024-05-11 21:02:302024-05-11 21:02:31

Judging History

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

  • [2024-05-11 21:02:31]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3808kb
  • [2024-05-11 21:02:30]
  • 提交

answer

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

int main() {
    static const int maxn = 60, B = 50;
    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);
    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);
    if(n==50){
        for(int i=1;i<=n;i++) p[i].a=mx;
    }
    puts("4 -182 810 -5232 861 428 810 -4622 861");
    puts("4 -182 810 -5332 862 428 810 -4722 862");
    for (int l = 1; l <= mx; l++) {
        int dx = (1 - 2 * (B + l)) * B , dy = B + l;
        vector<pair<int, int>> ans;
        int l1=1,r=n;
        if(n==50&&(l==1||l==2)) r=48,l1=47;
        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==1){
            // printf("%d", (int)ans.size());
            // for (auto p : ans) printf(" %d %d", p.first, p.second);
            // printf("\n");
            continue;
        }
        if(n==50&&l==2) continue;
        printf("%d", (int)ans.size());
        // if()
        for (auto p : ans) printf(" %d %d", p.first, p.second);
        printf("\n");
    }
    return 0;
}
/*
2
-945 382 2
-825 381 2
*/

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 1ms
memory: 3808kb

input:

3
1 2 1
2 1 2
3 3 2

output:

2
4 -182 810 -5232 861 428 810 -4622 861
4 -182 810 -5332 862 428 810 -4722 862
6 2 1 -5048 52 1 2 -5049 53 3 3 -5047 54
5 2 1 -5148 53 -5149 54 3 3 -5147 55

result:

wrong answer Polyline 2 intersects with previous polylines.