# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
402192 | 2021-05-11T12:08:40 Z | A_D | 원 고르기 (APIO18_circle_selection) | C++14 | 124 ms | 1100 KB |
#include <bits/stdc++.h> #define int long long #define ii pair<int,int> #define F first #define S second #define du long double using namespace std; const int N=5010; pair<ii,ii> a[N]; int vis[N]; void solve() { int n; cin>>n; for(int i=1;i<=n;i++){ scanf("%lld",&a[i].S.F); scanf("%lld",&a[i].S.S); scanf("%lld",&a[i].F.F); a[i].F.F*=-1; a[i].F.S=i; } sort(a+1,a+n+1); for(int i=1;i<=n;i++){ a[i].F.F*=-1; } int ans=0,t=n; while(t){ ans++; int u=0; for(int i=1;i<=n;i++){ if(vis[a[i].F.S]==0){ vis[a[i].F.S]=a[i].F.S; t--; u=i; break; } } for(int i=1;i<=n;i++){ if(vis[a[i].F.S]==0){ du x=a[i].S.F-a[u].S.F; du y=a[i].S.S-a[u].S.S; du dis=sqrt(x*x+y*y); du re=a[i].F.F+a[u].F.F; if(re>=dis){ vis[a[i].F.S]=vis[a[u].F.S]; t--; } } } } for(int i=1;i<=n;i++){ cout<<vis[i]<<" "; } } main() { int t=1; // cin>>t; while(t--)solve(); } /* 11 9 9 2 13 2 1 11 8 2 3 3 2 3 12 1 12 14 1 9 8 5 2 8 2 5 2 1 14 4 2 14 14 1 */
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 204 KB | Output is correct |
2 | Correct | 1 ms | 304 KB | Output is correct |
3 | Correct | 1 ms | 204 KB | Output is correct |
4 | Correct | 1 ms | 204 KB | Output is correct |
5 | Correct | 1 ms | 204 KB | Output is correct |
6 | Correct | 1 ms | 204 KB | Output is correct |
7 | Correct | 1 ms | 204 KB | Output is correct |
8 | Correct | 1 ms | 204 KB | Output is correct |
9 | Correct | 1 ms | 204 KB | Output is correct |
10 | Correct | 1 ms | 204 KB | Output is correct |
11 | Correct | 1 ms | 204 KB | Output is correct |
12 | Correct | 1 ms | 204 KB | Output is correct |
13 | Correct | 1 ms | 204 KB | Output is correct |
14 | Correct | 1 ms | 204 KB | Output is correct |
15 | Correct | 1 ms | 204 KB | Output is correct |
16 | Correct | 1 ms | 332 KB | Output is correct |
17 | Correct | 1 ms | 332 KB | Output is correct |
18 | Correct | 1 ms | 332 KB | Output is correct |
19 | Correct | 4 ms | 588 KB | Output is correct |
20 | Correct | 4 ms | 644 KB | Output is correct |
21 | Correct | 4 ms | 588 KB | Output is correct |
22 | Correct | 123 ms | 600 KB | Output is correct |
23 | Correct | 122 ms | 600 KB | Output is correct |
24 | Correct | 122 ms | 616 KB | Output is correct |
25 | Correct | 124 ms | 592 KB | Output is correct |
26 | Correct | 124 ms | 604 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 4 ms | 1100 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 204 KB | Output is correct |
2 | Runtime error | 4 ms | 972 KB | Execution killed with signal 11 |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Runtime error | 4 ms | 1032 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 204 KB | Output is correct |
2 | Correct | 1 ms | 304 KB | Output is correct |
3 | Correct | 1 ms | 204 KB | Output is correct |
4 | Correct | 1 ms | 204 KB | Output is correct |
5 | Correct | 1 ms | 204 KB | Output is correct |
6 | Correct | 1 ms | 204 KB | Output is correct |
7 | Correct | 1 ms | 204 KB | Output is correct |
8 | Correct | 1 ms | 204 KB | Output is correct |
9 | Correct | 1 ms | 204 KB | Output is correct |
10 | Correct | 1 ms | 204 KB | Output is correct |
11 | Correct | 1 ms | 204 KB | Output is correct |
12 | Correct | 1 ms | 204 KB | Output is correct |
13 | Correct | 1 ms | 204 KB | Output is correct |
14 | Correct | 1 ms | 204 KB | Output is correct |
15 | Correct | 1 ms | 204 KB | Output is correct |
16 | Correct | 1 ms | 332 KB | Output is correct |
17 | Correct | 1 ms | 332 KB | Output is correct |
18 | Correct | 1 ms | 332 KB | Output is correct |
19 | Correct | 4 ms | 588 KB | Output is correct |
20 | Correct | 4 ms | 644 KB | Output is correct |
21 | Correct | 4 ms | 588 KB | Output is correct |
22 | Correct | 123 ms | 600 KB | Output is correct |
23 | Correct | 122 ms | 600 KB | Output is correct |
24 | Correct | 122 ms | 616 KB | Output is correct |
25 | Correct | 124 ms | 592 KB | Output is correct |
26 | Correct | 124 ms | 604 KB | Output is correct |
27 | Runtime error | 4 ms | 972 KB | Execution killed with signal 11 |
28 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 204 KB | Output is correct |
2 | Correct | 1 ms | 304 KB | Output is correct |
3 | Correct | 1 ms | 204 KB | Output is correct |
4 | Correct | 1 ms | 204 KB | Output is correct |
5 | Correct | 1 ms | 204 KB | Output is correct |
6 | Correct | 1 ms | 204 KB | Output is correct |
7 | Correct | 1 ms | 204 KB | Output is correct |
8 | Correct | 1 ms | 204 KB | Output is correct |
9 | Correct | 1 ms | 204 KB | Output is correct |
10 | Correct | 1 ms | 204 KB | Output is correct |
11 | Correct | 1 ms | 204 KB | Output is correct |
12 | Correct | 1 ms | 204 KB | Output is correct |
13 | Correct | 1 ms | 204 KB | Output is correct |
14 | Correct | 1 ms | 204 KB | Output is correct |
15 | Correct | 1 ms | 204 KB | Output is correct |
16 | Correct | 1 ms | 332 KB | Output is correct |
17 | Correct | 1 ms | 332 KB | Output is correct |
18 | Correct | 1 ms | 332 KB | Output is correct |
19 | Correct | 4 ms | 588 KB | Output is correct |
20 | Correct | 4 ms | 644 KB | Output is correct |
21 | Correct | 4 ms | 588 KB | Output is correct |
22 | Correct | 123 ms | 600 KB | Output is correct |
23 | Correct | 122 ms | 600 KB | Output is correct |
24 | Correct | 122 ms | 616 KB | Output is correct |
25 | Correct | 124 ms | 592 KB | Output is correct |
26 | Correct | 124 ms | 604 KB | Output is correct |
27 | Runtime error | 4 ms | 1100 KB | Execution killed with signal 11 |
28 | Halted | 0 ms | 0 KB | - |