QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#409115#7680. Subwaylight_ink_dots#WA 1ms3712kbC++201.1kb2024-05-11 19:05:392024-05-11 19:05:39

Judging History

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

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

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);
    printf("%d\n", mx);
    for (int l = 1; l <= mx; l++) {
        int dx = (1 - 4 * (B + l)) * B - 1000, dy = 2 * B + l;
        vector<pair<int, int>> ans;
        for (int i = 1; i <= n; i++)
            if (p[i].a < l){
            	if(p[i].a==l-1)
					p[i].x -= 2 * B, p[i].y++;
				else p[i].x -= 4 * B, p[i].y+=2;
			}
        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; });
        for (int i = 1; i <= n; i++) {
            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;
}

详细

Test #1:

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

input:

3
1 2 1
2 1 2
3 3 2

output:

2
6 2 1 -400030998 20002 1 2 -400030999 20003 3 3 -400030997 20004
6 2 1 -400070998 20003 -19999 3 -400090999 20005 3 3 -400070997 20005

result:

wrong answer Polyline 2 intersects with previous polylines.