记录详情

Compile Error

/in/foo.cc: In function 'int finmaxneg(std::vector<int>&)':
/in/foo.cc:15:18: error: 'INT_MAX' was not declared in this scope
   15 |     int maxneg =-INT_MAX;
      |                  ^~~~~~~
/in/foo.cc:3:1: note: 'INT_MAX' is defined in header '<climits>'; did you forget to '#include <climits>'?
    2 | #include<vector>
  +++ |+#include <climits>
    3 | using namespace std;
/in/foo.cc:16:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   16 |     for (int j = 0; j < arr.size(); j++)
      |                     ~~^~~~~~~~~~~~
/in/foo.cc: In function 'int findmaxpos(std::vector<int>&)':
/in/foo.cc:28:16: error: 'INT_MAX' was not declared in this scope
   28 |     int val = -INT_MAX;
      |                ^~~~~~~
/in/foo.cc:28:16: note: 'INT_MAX' is defined in header '<climits>'; did you forget to '#include <climits>'?
/in/foo.cc:31:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   31 |     for (int j = 0; j < arr.size(); j++)
      |                     ~~^~~~~~~~~~~~
/in/foo.cc: In function 'int findmincount(std::vector<int>&)':
/in/foo.cc:43:15: error: 'INT_MAX' was not declared in this scope
   43 |     int min = INT_MAX;
      |               ^~~~~~~
/in/foo.cc:43:15: note: 'INT_MAX' is defined in header '<climits>'; did you forget to '#include <climits>'?
/in/foo.cc:45:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   45 |     for (int j = 0; j < arr.size(); j++)
      |                     ~~^~~~~~~~~~~~
/in/foo.cc: In function 'int findsecondmax(std::vector<int>&)':
/in/foo.cc:61:22: error: 'INT_MAX' was not declared in this scope
   61 |     arr[maxindex] = -INT_MAX;
      |                      ^~~~~~~
/in/foo.cc:61:22: note: 'INT_MAX' is defined in header '<climits>'; did you forget to '#include <climits>'?

信息

递交者
类型
递交
题目
A9-5 数组中最小值的个数
比赛
2025年暑期编程训练营之二
语言
C++
递交时间
2025-07-05 09:28:23
评测时间
2025-07-05 09:28:23
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes