QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#632424 | #9462. Safest Buildings | ucup-team5234# | AC ✓ | 0ms | 3652kb | C++17 | 2.0kb | 2024-10-12 13:22:23 | 2024-10-12 13:22:24 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
template<class T> using V = vector<T>;
template<class T> using VV = V<V<T>>;
template<class T> using VVV = V<VV<T>>;
template<class T> using VVVV = VV<VV<T>>;
#define rep(i,n) for(ll i=0ll;i<n;i++)
#define REP(i,a,n) for(ll i=a;i<n;i++)
const long long INF = (1LL << 60);
const long long mod99 = 998244353;
const long long mod107 = 1000000007;
const long long mod = mod99;
#define eb emplace_back
#define be(v) (v).begin(),(v).end()
#define all(i,v) for(auto& i : v)
#define UQ(v) sort(be(v)), v.erase(unique(be(v)), v.end())
#define LB(x,v) (lower_bound(be(v),(x))-(v).begin())
#define UB(x,v) (upper_bound(be(v),(x))-(v).begin())
#define dout() cout << fixed << setprecision(20)
#define randinit() srand((unsigned)time(NULL))
template<class T, class U> bool chmin(T& t, const U& u) { if (t > u){ t = u; return 1;} return 0; }
template<class T, class U> bool chmax(T& t, const U& u) { if (t < u){ t = u; return 1;} return 0; }
void solve(){
ll n,R,r;
cin >> n >> R >> r;
vector<pair<ll,ll>> b(n);
rep(i,n){
ll x,y;
cin >> x >> y;
b[i] = {x*x+y*y, i};
}
sort(be(b));
V<ll> ans;
if(0){
// V<ll> ans;
ll x = b[0].first;
for(auto[a,c]:b) if(a == x){
ans.eb(c);
}
}else{
// V<ll> ans;
for(auto[a,c]:b) if((2*r-R)*(2*r-R) >= a){
ans.eb(c);
}
if(ans.empty()){
ll x = b[0].first;
for(auto[a,c]:b) if(a == x){
ans.eb(c);
}
}
}
cout << ans.size() << endl;
ll m = ans.size();
sort(be(ans));
for(int i=0;i<ans.size();i++){
cout << ans[i]+1;
if(i!=m-1) cout << " ";
}
cout << endl;
}
int main(){
cin.tie(nullptr);
ios::sync_with_stdio(false);
int t=1;
cin >> t;
rep(i,t) solve();
}
这程序好像有点Bug,我给组数据试试?
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3652kb
input:
2 3 10 5 3 4 3 5 3 6 3 10 4 -7 -6 4 5 5 4
output:
1 1 2 2 3
result:
ok 5 tokens
Test #2:
score: 0
Accepted
time: 0ms
memory: 3588kb
input:
100 6 100 50 42 -31 -66 7 13 84 94 13 51 -14 -18 9 12 100 50 -78 56 -56 -64 -22 54 -41 14 -14 55 21 -83 75 21 -51 56 -31 74 -34 79 22 -37 1 -12 14 100 50 15 71 -44 41 -56 78 -48 22 42 -2 -70 28 51 -34 49 -31 -36 67 63 70 34 9 27 -33 36 -93 -52 -19 8 100 14 21 89 67 60 -12 -3 24 -37 -51 14 -30 8 -75 ...
output:
1 6 1 12 1 11 4 3 4 5 6 7 1 4 6 8 9 12 13 1 1 6 2 4 5 7 13 14 7 1 3 4 5 6 7 9 1 11 9 1 2 3 4 5 6 7 8 9 1 29 1 5 1 29 47 1 2 3 4 5 6 7 9 10 11 12 14 17 18 19 21 22 24 25 26 27 28 30 31 32 33 34 35 36 37 38 39 40 41 43 44 45 46 47 48 50 51 52 53 54 55 56 2 21 29 20 1 5 6 7 10 13 14 18 21 25 26 30 33 3...
result:
ok 1674 tokens
Extra Test:
score: 0
Extra Test Passed