记录详情

Compile Error

/in/foo.cc:6:10: error: 'Peak' was not declared in this scope
 bool cmp(Peak a, Peak b)
          ^~~~
/in/foo.cc:6:18: error: 'Peak' was not declared in this scope
 bool cmp(Peak a, Peak b)
                  ^~~~
/in/foo.cc:6:24: error: expression list treated as compound expression in initializer [-fpermissive]
 bool cmp(Peak a, Peak b)
                        ^
/in/foo.cc: In function 'int main()':
/in/foo.cc:15:17: error: 'Peak' was not declared in this scope
     std::vector<Peak> peaks;
                 ^~~~
/in/foo.cc:15:21: error: template argument 1 is invalid
     std::vector<Peak> peaks;
                     ^
/in/foo.cc:15:21: error: template argument 2 is invalid
/in/foo.cc:21:15: error: request for member 'push_back' in 'peaks', which is of non-class type 'int'
         peaks.push_back(Peak{x, y, h});
               ^~~~~~~~~
/in/foo.cc:21:29: error: expected ')' before '{' token
         peaks.push_back(Peak{x, y, h});
                             ^
/in/foo.cc:24:5: error: 'sort' is not a member of 'std'
     std::sort(peaks.begin(), peaks.end(), cmp);
     ^~~
/in/foo.cc:24:21: error: request for member 'begin' in 'peaks', which is of non-class type 'int'
     std::sort(peaks.begin(), peaks.end(), cmp);
                     ^~~~~
/in/foo.cc:24:36: error: request for member 'end' in 'peaks', which is of non-class type 'int'
     std::sort(peaks.begin(), peaks.end(), cmp);
                                    ^~~
/in/foo.cc:31:20: error: invalid types 'int[int]' for array subscript
         if (peaks[i].h > peaks.h)
                    ^
/in/foo.cc:31:32: error: request for member 'h' in 'peaks', which is of non-class type 'int'
         if (peaks[i].h > peaks.h)
                                ^
/in/foo.cc:37:9: error: 'st' was not declared in this scope
         st.push(peaks[i]);
         ^~
/in/foo.cc:37:24: error: invalid types 'int[int]' for array subscript
         st.push(peaks[i]);
                        ^

信息

递交者
类型
递交
比赛
泰院2401程序设计基础作业赛第七场
语言
C++
递交时间
2024-12-02 14:06:57
评测时间
2024-12-02 14:06:57
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes