QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#706896#9462. Safest BuildingschimuCompile Error//C++201019b2024-11-03 13:52:332024-11-03 13:52:34

Judging History

你现在查看的是最新测评结果

  • [2024-11-03 13:52:34]
  • 评测
  • [2024-11-03 13:52:33]
  • 提交

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;