# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
710028 | 2023-03-15T03:54:57 Z | vjudge1 | Circle selection (APIO18_circle_selection) | C++17 | 3000 ms | 14348 KB |
#include <bits/stdc++.h> #define int long long using namespace std; const int maxn = 3e5 + 10; typedef pair<int,int> ii; typedef pair<ii,int> iii; #define ff first #define ss second int calc(ii x, ii y) { return (x.ff-y.ff)*(x.ff-y.ff) + (x.ss-y.ss)*(x.ss-y.ss); } bool dau[maxn]; int res[maxn]; int n; iii a[maxn]; int id[maxn]; bool cmp(int x, int y) { if (a[x].ss!=a[y].ss) return a[x].ss>a[y].ss; return x<y; } signed main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); cin>>n; for (int i=1; i<=n; i++) { cin>>a[i].ff.ff>>a[i].ff.ss>>a[i].ss; dau[i]=0; id[i]=i; } sort(id+1,id+n+1,cmp); for (int i=1; i<=n; i++) { int j = id[i]; if (dau[j]) continue; dau[j] = 1; res[j] = j; for (int z=1; z<=n; z++) { if (dau[z]) continue; int temp = calc(a[z].ff,a[j].ff); int val = (a[j].ss + a[z].ss) * (a[j].ss + a[z].ss); if (temp<=val) { dau[z] = 1; res[z] = j; } } } for (int i=1; i<=n; i++) cout<<res[i]<<' '; cout<<'\n'; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 340 KB | Output is correct |
2 | Correct | 1 ms | 340 KB | Output is correct |
3 | Correct | 0 ms | 340 KB | Output is correct |
4 | Correct | 0 ms | 340 KB | Output is correct |
5 | Correct | 0 ms | 340 KB | Output is correct |
6 | Correct | 0 ms | 340 KB | Output is correct |
7 | Correct | 1 ms | 340 KB | Output is correct |
8 | Correct | 1 ms | 340 KB | Output is correct |
9 | Correct | 1 ms | 340 KB | Output is correct |
10 | Correct | 0 ms | 340 KB | Output is correct |
11 | Correct | 1 ms | 340 KB | Output is correct |
12 | Correct | 0 ms | 340 KB | Output is correct |
13 | Correct | 1 ms | 340 KB | Output is correct |
14 | Correct | 0 ms | 340 KB | Output is correct |
15 | Correct | 1 ms | 340 KB | Output is correct |
16 | Correct | 1 ms | 340 KB | Output is correct |
17 | Correct | 1 ms | 340 KB | Output is correct |
18 | Correct | 1 ms | 340 KB | Output is correct |
19 | Correct | 3 ms | 468 KB | Output is correct |
20 | Correct | 2 ms | 468 KB | Output is correct |
21 | Correct | 3 ms | 468 KB | Output is correct |
22 | Correct | 66 ms | 540 KB | Output is correct |
23 | Correct | 66 ms | 468 KB | Output is correct |
24 | Correct | 69 ms | 520 KB | Output is correct |
25 | Correct | 63 ms | 536 KB | Output is correct |
26 | Correct | 68 ms | 528 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 144 ms | 14328 KB | Output is correct |
2 | Correct | 144 ms | 14348 KB | Output is correct |
3 | Correct | 144 ms | 14228 KB | Output is correct |
4 | Correct | 144 ms | 14348 KB | Output is correct |
5 | Execution timed out | 3066 ms | 12348 KB | Time limit exceeded |
6 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 340 KB | Output is correct |
2 | Execution timed out | 3036 ms | 4316 KB | Time limit exceeded |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 3061 ms | 10044 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 340 KB | Output is correct |
2 | Correct | 1 ms | 340 KB | Output is correct |
3 | Correct | 0 ms | 340 KB | Output is correct |
4 | Correct | 0 ms | 340 KB | Output is correct |
5 | Correct | 0 ms | 340 KB | Output is correct |
6 | Correct | 0 ms | 340 KB | Output is correct |
7 | Correct | 1 ms | 340 KB | Output is correct |
8 | Correct | 1 ms | 340 KB | Output is correct |
9 | Correct | 1 ms | 340 KB | Output is correct |
10 | Correct | 0 ms | 340 KB | Output is correct |
11 | Correct | 1 ms | 340 KB | Output is correct |
12 | Correct | 0 ms | 340 KB | Output is correct |
13 | Correct | 1 ms | 340 KB | Output is correct |
14 | Correct | 0 ms | 340 KB | Output is correct |
15 | Correct | 1 ms | 340 KB | Output is correct |
16 | Correct | 1 ms | 340 KB | Output is correct |
17 | Correct | 1 ms | 340 KB | Output is correct |
18 | Correct | 1 ms | 340 KB | Output is correct |
19 | Correct | 3 ms | 468 KB | Output is correct |
20 | Correct | 2 ms | 468 KB | Output is correct |
21 | Correct | 3 ms | 468 KB | Output is correct |
22 | Correct | 66 ms | 540 KB | Output is correct |
23 | Correct | 66 ms | 468 KB | Output is correct |
24 | Correct | 69 ms | 520 KB | Output is correct |
25 | Correct | 63 ms | 536 KB | Output is correct |
26 | Correct | 68 ms | 528 KB | Output is correct |
27 | Correct | 5 ms | 724 KB | Output is correct |
28 | Correct | 6 ms | 724 KB | Output is correct |
29 | Correct | 5 ms | 724 KB | Output is correct |
30 | Correct | 304 ms | 736 KB | Output is correct |
31 | Correct | 279 ms | 724 KB | Output is correct |
32 | Correct | 305 ms | 724 KB | Output is correct |
33 | Correct | 49 ms | 4852 KB | Output is correct |
34 | Correct | 49 ms | 4840 KB | Output is correct |
35 | Correct | 54 ms | 4820 KB | Output is correct |
36 | Execution timed out | 3057 ms | 4328 KB | Time limit exceeded |
37 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 340 KB | Output is correct |
2 | Correct | 1 ms | 340 KB | Output is correct |
3 | Correct | 0 ms | 340 KB | Output is correct |
4 | Correct | 0 ms | 340 KB | Output is correct |
5 | Correct | 0 ms | 340 KB | Output is correct |
6 | Correct | 0 ms | 340 KB | Output is correct |
7 | Correct | 1 ms | 340 KB | Output is correct |
8 | Correct | 1 ms | 340 KB | Output is correct |
9 | Correct | 1 ms | 340 KB | Output is correct |
10 | Correct | 0 ms | 340 KB | Output is correct |
11 | Correct | 1 ms | 340 KB | Output is correct |
12 | Correct | 0 ms | 340 KB | Output is correct |
13 | Correct | 1 ms | 340 KB | Output is correct |
14 | Correct | 0 ms | 340 KB | Output is correct |
15 | Correct | 1 ms | 340 KB | Output is correct |
16 | Correct | 1 ms | 340 KB | Output is correct |
17 | Correct | 1 ms | 340 KB | Output is correct |
18 | Correct | 1 ms | 340 KB | Output is correct |
19 | Correct | 3 ms | 468 KB | Output is correct |
20 | Correct | 2 ms | 468 KB | Output is correct |
21 | Correct | 3 ms | 468 KB | Output is correct |
22 | Correct | 66 ms | 540 KB | Output is correct |
23 | Correct | 66 ms | 468 KB | Output is correct |
24 | Correct | 69 ms | 520 KB | Output is correct |
25 | Correct | 63 ms | 536 KB | Output is correct |
26 | Correct | 68 ms | 528 KB | Output is correct |
27 | Correct | 144 ms | 14328 KB | Output is correct |
28 | Correct | 144 ms | 14348 KB | Output is correct |
29 | Correct | 144 ms | 14228 KB | Output is correct |
30 | Correct | 144 ms | 14348 KB | Output is correct |
31 | Execution timed out | 3066 ms | 12348 KB | Time limit exceeded |
32 | Halted | 0 ms | 0 KB | - |