QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#636322 | #9462. Safest Buildings | ucup-team191# | TL | 0ms | 0kb | C++23 | 912b | 2024-10-12 23:21:43 | 2024-10-12 23:21:43 |
answer
#include <cstdio>
#include <string>
#include <iostream>
#include <vector>
#include <algorithm>
#define PB push_back
using namespace std;
typedef pair < int, int > pii;
int main(){
ios_base::sync_with_stdio(false); cin.tie(0);
int T; cin >> T;
for(;T--;) {
int n, r, R; scanf("%d%d%d", &n, &R, &r);
vector < pii > v;
for(int i = 1;i <= n;i++) {
int x, y; scanf("%d%d", &x, &y);
v.PB({x * x + y * y, i});
}
sort(v.begin(), v.end());
int ans = 0;
if(v[0].first <= (R - r) * (R - r)) {
for(pii x : v) ans += x.first <= (R - r) * (R - r);
printf("%d\n", ans);
for(pii x : v) if(x.first <= (R - r) * (R - r)) printf("%d ", x.second);
printf("\n");
} else {
for(pii x : v) ans += x.first == v[0].first;
printf("%d\n", ans);
for(pii x : v) if(x.first == v[0].first) printf("%d ", x.second);
printf("\n");
}
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Time Limit Exceeded
input:
2 3 10 5 3 4 3 5 3 6 3 10 4 -7 -6 4 5 5 4