Submission #829795

# Submission time Handle Problem Language Result Execution time Memory
829795 2023-08-18T15:04:32 Z tolbi Circle selection (APIO18_circle_selection) C++17
7 / 100
3000 ms 20920 KB
#pragma optimize("Bismillahirrahmanirrahim")
//█▀█─█──█──█▀█─█─█
//█▄█─█──█──█▄█─█■█
//█─█─█▄─█▄─█─█─█─█
//Allahuekber
//ahmet23 orz...
//FatihSultanMehmedHan
//YavuzSultanSelimHan
//AbdulhamidHan
//Sani buyuk Osman Pasa Plevneden cikmam diyor
#define author tolbi
#include <bits/stdc++.h>
using namespace std;
#define deci(x) int x;cin>>x;
#define decstr(x) string x;cin>>x;
#define sortarr(x) sort(x.begin(), x.end())
#define sortrarr(x) sort(x.rbegin(), x.rend())
#define rev(x) reverse(x.begin(), x.end())
#define cinarr(x) for (auto &it : x) cin>>it;
#define coutarr(x) for (auto &it : x) cout<<it<<" ";cout<<endl;
#define tol(bi) (1LL<<((int)(bi)))
#define endl '\n'
#define int long long
mt19937 ayahya(chrono::high_resolution_clock().now().time_since_epoch().count());
inline long double hoayda(int x1, int y1, int x2, int y2){
    return sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
}
int32_t main(){
    int T = 1;
    int tno = 0;
    while (T-(tno++)){
        deci(n);
        vector<array<int,4>> arr(n);
        for (int i = 0; i < n; ++i)
        {
            cin>>arr[i][0]>>arr[i][1]>>arr[i][2];
            arr[i][3]=i;
        }
        sort(arr.begin(), arr.end(), [&](array<int,4> a, array<int,4> b){
            if (a[2]==b[2]) return (a[3]>b[3]);
            return (a[2]<b[2]);
        });

        vector<int> ansarr(n,-1);
        vector<bool> vis(n,true);
        for (int i = n-1; i >= 0; i--){
            if (!vis[i]) continue;
            for (int j = 0; j <= i; j++){
                if (!vis[j]) continue;
                if (hoayda(arr[i][0],arr[i][1],arr[j][0],arr[j][1])<=arr[j][2]+arr[i][2]){
                    ansarr[arr[j][3]]=arr[i][3]+1;
                    vis[j]=false;
                }
            }
        }
        coutarr(ansarr);
    }
}

Compilation message

circle_selection.cpp:1: warning: ignoring '#pragma optimize ' [-Wunknown-pragmas]
    1 | #pragma optimize("Bismillahirrahmanirrahim")
      |
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 0 ms 308 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 1 ms 220 KB Output is correct
8 Correct 0 ms 300 KB Output is correct
9 Correct 0 ms 212 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 1 ms 212 KB Output is correct
12 Correct 1 ms 212 KB Output is correct
13 Correct 1 ms 212 KB Output is correct
14 Correct 1 ms 212 KB Output is correct
15 Correct 1 ms 212 KB Output is correct
16 Correct 2 ms 316 KB Output is correct
17 Correct 1 ms 340 KB Output is correct
18 Correct 1 ms 340 KB Output is correct
19 Correct 6 ms 620 KB Output is correct
20 Correct 5 ms 596 KB Output is correct
21 Correct 6 ms 628 KB Output is correct
22 Correct 51 ms 620 KB Output is correct
23 Correct 60 ms 620 KB Output is correct
24 Correct 52 ms 648 KB Output is correct
25 Correct 51 ms 620 KB Output is correct
26 Correct 60 ms 624 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 256 ms 20804 KB Output is correct
2 Correct 272 ms 20876 KB Output is correct
3 Correct 262 ms 20572 KB Output is correct
4 Correct 277 ms 20920 KB Output is correct
5 Execution timed out 3058 ms 16716 KB Time limit exceeded
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Execution timed out 3046 ms 7004 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 3066 ms 19924 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 0 ms 308 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 1 ms 220 KB Output is correct
8 Correct 0 ms 300 KB Output is correct
9 Correct 0 ms 212 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 1 ms 212 KB Output is correct
12 Correct 1 ms 212 KB Output is correct
13 Correct 1 ms 212 KB Output is correct
14 Correct 1 ms 212 KB Output is correct
15 Correct 1 ms 212 KB Output is correct
16 Correct 2 ms 316 KB Output is correct
17 Correct 1 ms 340 KB Output is correct
18 Correct 1 ms 340 KB Output is correct
19 Correct 6 ms 620 KB Output is correct
20 Correct 5 ms 596 KB Output is correct
21 Correct 6 ms 628 KB Output is correct
22 Correct 51 ms 620 KB Output is correct
23 Correct 60 ms 620 KB Output is correct
24 Correct 52 ms 648 KB Output is correct
25 Correct 51 ms 620 KB Output is correct
26 Correct 60 ms 624 KB Output is correct
27 Correct 10 ms 980 KB Output is correct
28 Correct 10 ms 960 KB Output is correct
29 Correct 11 ms 928 KB Output is correct
30 Correct 200 ms 956 KB Output is correct
31 Correct 194 ms 948 KB Output is correct
32 Correct 247 ms 960 KB Output is correct
33 Correct 101 ms 7820 KB Output is correct
34 Correct 104 ms 7904 KB Output is correct
35 Correct 98 ms 7768 KB Output is correct
36 Execution timed out 3064 ms 6736 KB Time limit exceeded
37 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 0 ms 308 KB Output is correct
5 Correct 0 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 1 ms 220 KB Output is correct
8 Correct 0 ms 300 KB Output is correct
9 Correct 0 ms 212 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 1 ms 212 KB Output is correct
12 Correct 1 ms 212 KB Output is correct
13 Correct 1 ms 212 KB Output is correct
14 Correct 1 ms 212 KB Output is correct
15 Correct 1 ms 212 KB Output is correct
16 Correct 2 ms 316 KB Output is correct
17 Correct 1 ms 340 KB Output is correct
18 Correct 1 ms 340 KB Output is correct
19 Correct 6 ms 620 KB Output is correct
20 Correct 5 ms 596 KB Output is correct
21 Correct 6 ms 628 KB Output is correct
22 Correct 51 ms 620 KB Output is correct
23 Correct 60 ms 620 KB Output is correct
24 Correct 52 ms 648 KB Output is correct
25 Correct 51 ms 620 KB Output is correct
26 Correct 60 ms 624 KB Output is correct
27 Correct 256 ms 20804 KB Output is correct
28 Correct 272 ms 20876 KB Output is correct
29 Correct 262 ms 20572 KB Output is correct
30 Correct 277 ms 20920 KB Output is correct
31 Execution timed out 3058 ms 16716 KB Time limit exceeded
32 Halted 0 ms 0 KB -