QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#636326 | #9462. Safest Buildings | ucup-team191# | WA | 1ms | 3880kb | C++23 | 831b | 2024-10-12 23:22:44 | 2024-10-12 23:22:44 |
Judging History
answer
#include <cstdio>
#include <vector>
#include <algorithm>
#define PB push_back
using namespace std;
typedef pair < int, int > pii;
int main(){
int T; scanf("%d", &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: 100
Accepted
time: 0ms
memory: 3880kb
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: -100
Wrong Answer
time: 1ms
memory: 3800kb
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 3 12 11 4 3 11 5 12 6 3 6 4 5 7 8 9 12 4 13 9 1 6 8 3 11 2 1 5 3 5 7 2 1 9 1 11 1 5 15 29 5 21 14 13 36 25 26 8 10 23 28 22 37 33 6 5 12 4 28 13 16 16 29 39 53 67 69 72 38 18 71 30 58 31 64 49 20 73 51 33 25 48 45 7 18 43 19 2 27 32 17 38 54 3 14 12 56 22 41 28 36 34 44 6 47 21 55 3...
result:
wrong answer 3rd words differ - expected: '1', found: '3'