제출 #887220

#제출 시각아이디문제언어결과실행 시간메모리
887220Muhammad_Aneeq삶의 질 (IOI10_quality)C++17
60 / 100
5058 ms25940 KiB
#include <set> #include <algorithm> using namespace std; int rectangle(int R,int C,int H,int W,int Q[3001][3001]) { int ans=1e9+10; for (int i=0;i<=R-H;i++) { set<int>s; for (int j=i;j<i+H;j++) for (int k=0;k<W;k++) { s.insert(Q[j][k]); if (s.size()>(H*W)/2+1) s.erase(*--end(s)); } auto z=--end(s); ans=min(ans,*z); // print(s); for (int j=W;j<C;j++) { for (int k=i;k<i+H;k++) s.erase(Q[k][j-W]); for (int k=i;k<i+H;k++) { s.insert(Q[k][j]); if (s.size()>(H*W)/2+1) s.erase(*--end(s)); } // print(s); auto z=--end(s); ans=min(ans,*z); } } return ans; }

컴파일 시 표준 에러 (stderr) 메시지

quality.cpp: In function 'int rectangle(int, int, int, int, int (*)[3001])':
quality.cpp:13:17: warning: comparison of integer expressions of different signedness: 'std::set<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   13 |     if (s.size()>(H*W)/2+1)
      |         ~~~~~~~~^~~~~~~~~~
quality.cpp:26:17: warning: comparison of integer expressions of different signedness: 'std::set<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   26 |     if (s.size()>(H*W)/2+1)
      |         ~~~~~~~~^~~~~~~~~~
#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...