Submission #49361

# Submission time Handle Problem Language Result Execution time Memory
49361 2018-05-27T14:10:40 Z 노영훈(#1273, Diuven) Circle selection (APIO18_circle_selection) C++
7 / 100
3000 ms 7660 KB
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int MX=300010, inf=2e9;

ll sq(int x){
	return 1LL*x*x;
}

struct circle {
	int x, y, r, kill;
	bool operator ^ (const circle &c) const {
		return sq(x-c.x)+sq(y-c.y)<=sq(r+c.r);
	}
} C[MX];

int n;

int main(){
	ios::sync_with_stdio(0); cin.tie(0);
	cin>>n;
	for(int i=1; i<=n; i++){
		cin>>C[i].x>>C[i].y>>C[i].r;
	}
	bool out[MX]={};
	for(int _=1; _<=n; _++){
		int now=-1;
		for(int i=1; i<=n; i++){
			if(out[i]) continue;
			if(now<0 || C[now].r<C[i].r) now=i;
		}
		if(now<0) break;
		for(int i=1; i<=n; i++){
			if(out[i]) continue;
			if(C[i]^C[now]) C[i].kill=now, out[i]=true;
		}
	}
	for(int i=1; i<=n; i++) cout<<C[i].kill<<' ';
	return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 2 ms 636 KB Output is correct
2 Correct 2 ms 636 KB Output is correct
3 Correct 2 ms 664 KB Output is correct
4 Correct 2 ms 664 KB Output is correct
5 Correct 2 ms 664 KB Output is correct
6 Correct 2 ms 852 KB Output is correct
7 Correct 2 ms 852 KB Output is correct
8 Correct 2 ms 852 KB Output is correct
9 Correct 2 ms 852 KB Output is correct
10 Correct 2 ms 852 KB Output is correct
11 Correct 3 ms 852 KB Output is correct
12 Correct 2 ms 852 KB Output is correct
13 Correct 3 ms 852 KB Output is correct
14 Correct 2 ms 852 KB Output is correct
15 Correct 2 ms 868 KB Output is correct
16 Correct 2 ms 868 KB Output is correct
17 Correct 3 ms 868 KB Output is correct
18 Correct 3 ms 1000 KB Output is correct
19 Correct 8 ms 1004 KB Output is correct
20 Correct 8 ms 1008 KB Output is correct
21 Correct 6 ms 1020 KB Output is correct
22 Correct 239 ms 1036 KB Output is correct
23 Correct 199 ms 1052 KB Output is correct
24 Correct 205 ms 1060 KB Output is correct
25 Correct 209 ms 1072 KB Output is correct
26 Correct 195 ms 1072 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 214 ms 7660 KB Output is correct
2 Correct 162 ms 7660 KB Output is correct
3 Correct 184 ms 7660 KB Output is correct
4 Correct 147 ms 7660 KB Output is correct
5 Execution timed out 3010 ms 7660 KB Time limit exceeded
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 7660 KB Output is correct
2 Execution timed out 3019 ms 7660 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 3008 ms 7660 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 636 KB Output is correct
2 Correct 2 ms 636 KB Output is correct
3 Correct 2 ms 664 KB Output is correct
4 Correct 2 ms 664 KB Output is correct
5 Correct 2 ms 664 KB Output is correct
6 Correct 2 ms 852 KB Output is correct
7 Correct 2 ms 852 KB Output is correct
8 Correct 2 ms 852 KB Output is correct
9 Correct 2 ms 852 KB Output is correct
10 Correct 2 ms 852 KB Output is correct
11 Correct 3 ms 852 KB Output is correct
12 Correct 2 ms 852 KB Output is correct
13 Correct 3 ms 852 KB Output is correct
14 Correct 2 ms 852 KB Output is correct
15 Correct 2 ms 868 KB Output is correct
16 Correct 2 ms 868 KB Output is correct
17 Correct 3 ms 868 KB Output is correct
18 Correct 3 ms 1000 KB Output is correct
19 Correct 8 ms 1004 KB Output is correct
20 Correct 8 ms 1008 KB Output is correct
21 Correct 6 ms 1020 KB Output is correct
22 Correct 239 ms 1036 KB Output is correct
23 Correct 199 ms 1052 KB Output is correct
24 Correct 205 ms 1060 KB Output is correct
25 Correct 209 ms 1072 KB Output is correct
26 Correct 195 ms 1072 KB Output is correct
27 Correct 8 ms 7660 KB Output is correct
28 Correct 8 ms 7660 KB Output is correct
29 Correct 8 ms 7660 KB Output is correct
30 Correct 863 ms 7660 KB Output is correct
31 Correct 801 ms 7660 KB Output is correct
32 Correct 792 ms 7660 KB Output is correct
33 Correct 63 ms 7660 KB Output is correct
34 Correct 75 ms 7660 KB Output is correct
35 Correct 71 ms 7660 KB Output is correct
36 Execution timed out 3053 ms 7660 KB Time limit exceeded
37 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 636 KB Output is correct
2 Correct 2 ms 636 KB Output is correct
3 Correct 2 ms 664 KB Output is correct
4 Correct 2 ms 664 KB Output is correct
5 Correct 2 ms 664 KB Output is correct
6 Correct 2 ms 852 KB Output is correct
7 Correct 2 ms 852 KB Output is correct
8 Correct 2 ms 852 KB Output is correct
9 Correct 2 ms 852 KB Output is correct
10 Correct 2 ms 852 KB Output is correct
11 Correct 3 ms 852 KB Output is correct
12 Correct 2 ms 852 KB Output is correct
13 Correct 3 ms 852 KB Output is correct
14 Correct 2 ms 852 KB Output is correct
15 Correct 2 ms 868 KB Output is correct
16 Correct 2 ms 868 KB Output is correct
17 Correct 3 ms 868 KB Output is correct
18 Correct 3 ms 1000 KB Output is correct
19 Correct 8 ms 1004 KB Output is correct
20 Correct 8 ms 1008 KB Output is correct
21 Correct 6 ms 1020 KB Output is correct
22 Correct 239 ms 1036 KB Output is correct
23 Correct 199 ms 1052 KB Output is correct
24 Correct 205 ms 1060 KB Output is correct
25 Correct 209 ms 1072 KB Output is correct
26 Correct 195 ms 1072 KB Output is correct
27 Correct 214 ms 7660 KB Output is correct
28 Correct 162 ms 7660 KB Output is correct
29 Correct 184 ms 7660 KB Output is correct
30 Correct 147 ms 7660 KB Output is correct
31 Execution timed out 3010 ms 7660 KB Time limit exceeded
32 Halted 0 ms 0 KB -