QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#409145 | #7680. Subway | light_ink_dots | WA | 0ms | 3816kb | C++14 | 1.0kb | 2024-05-11 19:39:43 | 2024-05-11 19:39:44 |
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];
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){
// cout<<mx<<" "<<mn<<endl;
}
for (int l = 1; l <= mx; l++) {
int dx = (1 - 2 * (B + l)) * B - 1000, dy = B + l;
vector<pair<int, int>> ans;
for (int i = 1; i <= n; i++) {
if(p[i].a>=l+1)
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: 3816kb
input:
3 1 2 1 2 1 2 3 3 2
output:
2 5 2 1 -200010998 10002 -200010999 10003 3 3 -200010997 10004 3 -200030998 10003 -200030999 10004 -200030997 10005
result:
wrong answer Station 1 not passed through by required amount of subway lines.