QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#409233 | #7680. Subway | light_ink_dots | Compile Error | / | / | C++14 | 1.4kb | 2024-05-11 20:44:01 | 2024-05-11 20:44:01 |
Judging History
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){
// cout<<mx<<" "<<mn<<endl;
for(int i=1;i<=n;i++) p[i].a=mx;
// for(int i=1;i<=)
}
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=40,l1=38;
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");
}
// 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;
}
/*
4
961 -919 2
-306 -897 2
334 -893 2
-371 -812 2
*/
Details
answer.code: In function ‘int main()’: answer.code:39:12: error: expected primary-expression before ‘)’ token 39 | if() | ^ answer.code:7:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 7 | scanf("%d", &n); | ~~~~~^~~~~~~~~~ answer.code:13:39: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 13 | 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); | ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~