QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#706896 | #9462. Safest Buildings | chimu | Compile Error | / | / | C++20 | 1019b | 2024-11-03 13:52:33 | 2024-11-03 13:52:34 |
Judging History
answer
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <cmath>
using namespace std;
int z = 1e9 + 7;
int main()
{
cin.tie(0),cout.sync_with_stdio(0);
int t;
cin >> t;
while(t--)
{
int n , R , r , res = 0;
int mi = INT_MAX;
cin >> n >> R >> r;
vector<int> re(n);
for(int i = 0 ; i < n ; i++)
{
int a , b;
cin >> a >> b;
int dis = a * a + b * b;
if(dis < R * R)
{
if(dis < mi)
{
mi = dis;
res = 0;
re[res++] = i + 1;
}
else if(dis == mi)
{
re[res++] = i + 1;
}
}
}
cout << res << endl << re[0];
for(int i = 1 ; i < res ; i++)
{
cout << " " << re[i];
}
cout << endl;
}
}
Details
answer.code: In function ‘int main()’: answer.code:16:18: error: ‘INT_MAX’ was not declared in this scope 16 | int mi = INT_MAX; | ^~~~~~~ answer.code:6:1: note: ‘INT_MAX’ is defined in header ‘<climits>’; did you forget to ‘#include <climits>’? 5 | #include <cmath> +++ |+#include <climits> 6 | using namespace std;