Submission #744421

# Submission time Handle Problem Language Result Execution time Memory
744421 2023-05-18T14:39:04 Z haidara44 Circle selection (APIO18_circle_selection) C++17
0 / 100
3000 ms 1048576 KB
#include <bits/stdc++.h>

using namespace std;
#define endl '\n'
#define intt long long
#define mid (l+r)/2

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    intt n;
    cin>>n;
    vector<pair<pair<intt,intt>,intt>>v;
    map<intt,intt>m;
    set<intt>s;
    map<intt,vector<int>>d;
    for(int i=0;i<n;i++)
    {
        intt x,y,r;
        cin>>x>>y>>r;
        v.push_back({{r,-i},x});
        s.insert(x-r);
        d[x-r].push_back(i);
    }
    sort(v.begin(),v.end());
    reverse(v.begin(),v.end());
    for(int i=0;i<n;i++)
    {
        intt o=-v[i].first.second;
        intt x=v[i].second;
        intt r=v[i].first.first;
        intt l=x-r;
        intt l1=x+r;
        auto u=s.lower_bound(l);
        auto f=s.upper_bound(l1);
        vector<intt>vg;
        for(f;f!=u;f++)
        {
            for(auto h:d[*f])
                m[h]=o+1;
            vg.push_back(*f);
        }
        for(auto k:vg)
            s.erase(k);
    }
    for(auto u:m)
        cout<<u.second<<" ";
    return 0;
}

Compilation message

circle_selection.cpp: In function 'int main()':
circle_selection.cpp:39:13: warning: statement has no effect [-Wunused-value]
   39 |         for(f;f!=u;f++)
      |             ^
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 3120 ms 591364 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1652 ms 1048576 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 3040 ms 596956 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -