QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#409506 | #7680. Subway | light_ink_dots | WA | 1ms | 4116kb | C++14 | 938b | 2024-05-12 10:21:27 | 2024-05-12 10:21:28 |
Judging History
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);
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);
for (int l = mx; l; l--) {
int dx = (1 - 2 * l) * B - 1000, 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;
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 4076kb
input:
3 1 2 1 2 1 2 3 3 2
output:
2 5 2 1 -30998 3 -30999 4 3 3 -30997 5 6 2 1 -10998 2 1 2 -10999 3 3 3 -10997 4
result:
ok ok Sum L = 11
Test #2:
score: 0
Accepted
time: 0ms
memory: 3852kb
input:
1 1 1 1
output:
1 2 1 1 -10999 2
result:
ok ok Sum L = 2
Test #3:
score: 0
Accepted
time: 0ms
memory: 3824kb
input:
1 1 1 50
output:
50 2 1 1 -990999 51 2 1 1 -970999 50 2 1 1 -950999 49 2 1 1 -930999 48 2 1 1 -910999 47 2 1 1 -890999 46 2 1 1 -870999 45 2 1 1 -850999 44 2 1 1 -830999 43 2 1 1 -810999 42 2 1 1 -790999 41 2 1 1 -770999 40 2 1 1 -750999 39 2 1 1 -730999 38 2 1 1 -710999 37 2 1 1 -690999 36 2 1 1 -670999 35 2 1 1 -6...
result:
ok ok Sum L = 100
Test #4:
score: -100
Wrong Answer
time: 1ms
memory: 4116kb
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 52 -990039 -869 -991306 -847 -990666 -843 -991371 -762 -991885 -725 -991668 -675 -991462 -669 -990798 -652 -870 -697 -991870 -647 -991888 -617 -991548 -602 -990338 -517 -990264 -501 -991784 -487 -991579 -387 -990652 -272 -990383 -255 -3 -296 -991003 -246 -991469 -206 -991981 -143 -990865 -137 -99...
result:
wrong answer Polyline 23 intersects with previous polylines.