Submission #1175716

#TimeUsernameProblemLanguageResultExecution timeMemory
1175716skibidoiQuality Of Living (IOI10_quality)C++17
Compilation error
0 ms0 KiB
#include"quality.h" using namespace std; int rectangle(int r,int c,int h,int w,vector<vector<int>>&q){ int ans=INT_MAX; vector<int> cnt; for(int i=0;i<=r-h;i++){ for(int j=0;j<=c-w;j++){ cnt.clear(); for(int x=0;x<h;x++){ for(int y=0;y<w;y++){ cnt.push_back(q[i+x][j+y]); } } sort(cnt.begin(),cnt.end()); int wtf = cnt[(h*w)/2]; ans=min(ans,wtf); } } return ans; }

Compilation message (stderr)

quality.cpp:5:39: error: 'vector' has not been declared
    5 | int rectangle(int r,int c,int h,int w,vector<vector<int>>&q){
      |                                       ^~~~~~
quality.cpp:5:45: error: expected ',' or '...' before '<' token
    5 | int rectangle(int r,int c,int h,int w,vector<vector<int>>&q){
      |                                             ^
quality.cpp: In function 'int rectangle(int, int, int, int, int)':
quality.cpp:6:13: error: 'INT_MAX' was not declared in this scope
    6 |     int ans=INT_MAX;
      |             ^~~~~~~
quality.cpp:3:1: note: 'INT_MAX' is defined in header '<climits>'; did you forget to '#include <climits>'?
    2 | #include"quality.h"
  +++ |+#include <climits>
    3 | using namespace std;
quality.cpp:8:5: error: 'vector' was not declared in this scope
    8 |     vector<int> cnt;
      |     ^~~~~~
quality.cpp:3:1: note: 'std::vector' is defined in header '<vector>'; did you forget to '#include <vector>'?
    2 | #include"quality.h"
  +++ |+#include <vector>
    3 | using namespace std;
quality.cpp:8:12: error: expected primary-expression before 'int'
    8 |     vector<int> cnt;
      |            ^~~
quality.cpp:11:13: error: 'cnt' was not declared in this scope; did you mean 'int'?
   11 |             cnt.clear();
      |             ^~~
      |             int
quality.cpp:14:35: error: 'q' was not declared in this scope
   14 |                     cnt.push_back(q[i+x][j+y]);
      |                                   ^
quality.cpp:17:13: error: 'sort' was not declared in this scope; did you mean 'short'?
   17 |             sort(cnt.begin(),cnt.end());
      |             ^~~~
      |             short
quality.cpp:19:17: error: 'min' was not declared in this scope
   19 |             ans=min(ans,wtf);
      |                 ^~~