Submission #288063

#TimeUsernameProblemLanguageResultExecution timeMemory
288063dolijanQuality Of Living (IOI10_quality)C++14
0 / 100
7 ms512 KiB
#include <bits/stdc++.h> #include <stdlib.h> //#include "quality.h" using namespace std; const int mn=3001; int f(set<int>s) { int sredina=s.size()/2; set<int>::iterator it=s.begin(); int sta=0; while(it!=s.end()) { sta++; it++; if(sta==sredina) return *it; } return 1; } int rectangle1(int r,int c,int h,int w,int q[mn][mn]) { int mn=r*c; for(int i=0;i<=r-h;i++) { set<int> s; for(int j=i;j<i+h;j++) { for(int k=0;k<c;k++) { s.insert(q[j][k]); } } mn=min(f(s),mn); for(int j=1;j<=c-w;j++) { for(int k=i;k<i+h;k++) s.erase(q[k][j-1]); for(int k=i;k<i+h;k++) s.insert(q[k][j+w-1]); mn=min(f(s),mn); } } return mn; } int rectangle(int R, int C, int H, int W, int Q[3001][3001]) { return rectangle1(R,C,H,W,Q); } static int R,C,H,W,Q[3001][3001],i,j,ans; /* int main(){ scanf("%d%d%d%d",&R,&C,&H,&W); for (i=0;i<R;i++) for (j=0;j<C;j++) scanf("%d",&Q[i][j]); ans = rectangle(R,C,H,W,Q); printf("%d\n",ans); return 0; }*/

Compilation message (stderr)

quality.cpp:45:38: warning: 'ans' defined but not used [-Wunused-variable]
   45 | static int R,C,H,W,Q[3001][3001],i,j,ans;
      |                                      ^~~
quality.cpp:45:36: warning: 'j' defined but not used [-Wunused-variable]
   45 | static int R,C,H,W,Q[3001][3001],i,j,ans;
      |                                    ^
quality.cpp:45:34: warning: 'i' defined but not used [-Wunused-variable]
   45 | static int R,C,H,W,Q[3001][3001],i,j,ans;
      |                                  ^
quality.cpp:45:20: warning: 'Q' defined but not used [-Wunused-variable]
   45 | static int R,C,H,W,Q[3001][3001],i,j,ans;
      |                    ^
quality.cpp:45:18: warning: 'W' defined but not used [-Wunused-variable]
   45 | static int R,C,H,W,Q[3001][3001],i,j,ans;
      |                  ^
quality.cpp:45:16: warning: 'H' defined but not used [-Wunused-variable]
   45 | static int R,C,H,W,Q[3001][3001],i,j,ans;
      |                ^
quality.cpp:45:14: warning: 'C' defined but not used [-Wunused-variable]
   45 | static int R,C,H,W,Q[3001][3001],i,j,ans;
      |              ^
quality.cpp:45:12: warning: 'R' defined but not used [-Wunused-variable]
   45 | static int R,C,H,W,Q[3001][3001],i,j,ans;
      |            ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...