제출 #952261

#제출 시각아이디문제언어결과실행 시간메모리
952261Doncho_Bonboncho삶의 질 (IOI10_quality)C++14
40 / 100
5045 ms5724 KiB
#include <bits/stdc++.h> #include "quality.h" #pragma GCC optimize ("O3") #pragma GCC target ("sse4") using namespace std; template<class T, class T2> inline bool chkmax(T &x, const T2 &y) { return x < y ? x = y, 1 : 0; } template<class T, class T2> inline bool chkmin(T &x, const T2 &y) { return x > y ? x = y, 1 : 0; } #ifndef LOCAL #define cerr if(false) cerr #define endl "\n" #endif #define out(x) #x << "=" << x << " " int rectangle(int R, int C, int H, int W, int Q[3001][3001]) { int nas = R * C +1; std::set< int > S; for( int i=0 ; i + H <= R ; i ++ ){ S.clear(); for( int I = i; I < i + H ; I++ ){ int j = 0; for( int J = j ; J < j + W ; J++ ){ S.insert( Q[I][J] ); } } for( int j=0 ; j + W <= C ; j++ ){ if( j ){ for( int I = i ; I < i + H ; I++ ){ S.erase( Q[I][j-1] ); S.insert( Q[I][j+W-1] ); } } auto it = S.begin(); std::advance( it, S.size()/2 ); chkmin( nas, *it ); } } return nas; }
#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...