QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#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;
}
}
詳細信息
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;