Submission #252460

# Submission time Handle Problem Language Result Execution time Memory
252460 2020-07-25T15:51:33 Z Sugardorj Circle selection (APIO18_circle_selection) C++14
7 / 100
3000 ms 1048580 KB
#include <bits/stdc++.h>
using namespace std;
long long b[323567],c[223456],a[323456],tt,d[234564];
long long x,m,n,t,k,l;
long long i , j,r,s,y,z;
vector <long long> p[332345];
priority_queue <pair<long long,long long>>q;
int main(){
    cin>> n;
    for (i = 1; i <=n; i ++){
        cin >>a[i]>>b[i]>>c[i];
        q.push({c[i],-i});
        for (j = 1; j<i; j ++){
            if((a[i]-a[j])*(a[i]-a[j])+(b[i]-b[j])*(b[i]-b[j])<=(c[i]+c[j])*(c[i]+c[j])){
                p[i].push_back(j);
                p[j].push_back(i);
            }
        } 
    }
    for (i = 0; i <n; i ++){
        y = -q.top().second;
        q.pop();
        if (d[y])
            continue;
        d[y]=y;
        //cout << y<<' ';
        for(auto u:p[y]){
            if (d[u])
                continue;
            else d[u] = y;
        }
    }
    for (i = 1; i<=n; i ++)
        cout << d[i]<<' ';
}
# Verdict Execution time Memory Grader output
1 Correct 5 ms 8192 KB Output is correct
2 Correct 5 ms 8192 KB Output is correct
3 Correct 5 ms 8192 KB Output is correct
4 Correct 5 ms 8192 KB Output is correct
5 Correct 5 ms 8192 KB Output is correct
6 Correct 5 ms 8320 KB Output is correct
7 Correct 5 ms 8192 KB Output is correct
8 Correct 5 ms 8192 KB Output is correct
9 Correct 5 ms 8192 KB Output is correct
10 Correct 6 ms 8192 KB Output is correct
11 Correct 7 ms 8192 KB Output is correct
12 Correct 5 ms 8192 KB Output is correct
13 Correct 7 ms 8192 KB Output is correct
14 Correct 5 ms 8192 KB Output is correct
15 Correct 5 ms 8192 KB Output is correct
16 Correct 19 ms 15868 KB Output is correct
17 Correct 19 ms 15488 KB Output is correct
18 Correct 20 ms 16384 KB Output is correct
19 Correct 369 ms 271228 KB Output is correct
20 Correct 346 ms 267768 KB Output is correct
21 Correct 284 ms 153728 KB Output is correct
22 Correct 56 ms 8568 KB Output is correct
23 Correct 57 ms 8568 KB Output is correct
24 Correct 57 ms 8568 KB Output is correct
25 Correct 58 ms 8572 KB Output is correct
26 Correct 57 ms 8568 KB Output is correct
# Verdict Execution time Memory Grader output
1 Runtime error 1796 ms 1048580 KB Execution killed with signal 9 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 5 ms 8192 KB Output is correct
2 Execution timed out 3082 ms 10656 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 3080 ms 10536 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 5 ms 8192 KB Output is correct
2 Correct 5 ms 8192 KB Output is correct
3 Correct 5 ms 8192 KB Output is correct
4 Correct 5 ms 8192 KB Output is correct
5 Correct 5 ms 8192 KB Output is correct
6 Correct 5 ms 8320 KB Output is correct
7 Correct 5 ms 8192 KB Output is correct
8 Correct 5 ms 8192 KB Output is correct
9 Correct 5 ms 8192 KB Output is correct
10 Correct 6 ms 8192 KB Output is correct
11 Correct 7 ms 8192 KB Output is correct
12 Correct 5 ms 8192 KB Output is correct
13 Correct 7 ms 8192 KB Output is correct
14 Correct 5 ms 8192 KB Output is correct
15 Correct 5 ms 8192 KB Output is correct
16 Correct 19 ms 15868 KB Output is correct
17 Correct 19 ms 15488 KB Output is correct
18 Correct 20 ms 16384 KB Output is correct
19 Correct 369 ms 271228 KB Output is correct
20 Correct 346 ms 267768 KB Output is correct
21 Correct 284 ms 153728 KB Output is correct
22 Correct 56 ms 8568 KB Output is correct
23 Correct 57 ms 8568 KB Output is correct
24 Correct 57 ms 8568 KB Output is correct
25 Correct 58 ms 8572 KB Output is correct
26 Correct 57 ms 8568 KB Output is correct
27 Correct 1287 ms 723956 KB Output is correct
28 Correct 1521 ms 974068 KB Output is correct
29 Correct 1499 ms 928500 KB Output is correct
30 Correct 191 ms 8888 KB Output is correct
31 Correct 191 ms 8820 KB Output is correct
32 Correct 191 ms 8820 KB Output is correct
33 Runtime error 1525 ms 1048580 KB Execution killed with signal 9 (could be triggered by violating memory limits)
34 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 5 ms 8192 KB Output is correct
2 Correct 5 ms 8192 KB Output is correct
3 Correct 5 ms 8192 KB Output is correct
4 Correct 5 ms 8192 KB Output is correct
5 Correct 5 ms 8192 KB Output is correct
6 Correct 5 ms 8320 KB Output is correct
7 Correct 5 ms 8192 KB Output is correct
8 Correct 5 ms 8192 KB Output is correct
9 Correct 5 ms 8192 KB Output is correct
10 Correct 6 ms 8192 KB Output is correct
11 Correct 7 ms 8192 KB Output is correct
12 Correct 5 ms 8192 KB Output is correct
13 Correct 7 ms 8192 KB Output is correct
14 Correct 5 ms 8192 KB Output is correct
15 Correct 5 ms 8192 KB Output is correct
16 Correct 19 ms 15868 KB Output is correct
17 Correct 19 ms 15488 KB Output is correct
18 Correct 20 ms 16384 KB Output is correct
19 Correct 369 ms 271228 KB Output is correct
20 Correct 346 ms 267768 KB Output is correct
21 Correct 284 ms 153728 KB Output is correct
22 Correct 56 ms 8568 KB Output is correct
23 Correct 57 ms 8568 KB Output is correct
24 Correct 57 ms 8568 KB Output is correct
25 Correct 58 ms 8572 KB Output is correct
26 Correct 57 ms 8568 KB Output is correct
27 Runtime error 1796 ms 1048580 KB Execution killed with signal 9 (could be triggered by violating memory limits)
28 Halted 0 ms 0 KB -