Submission #952258

#TimeUsernameProblemLanguageResultExecution timeMemory
952258Doncho_BonbonchoQuality Of Living (IOI10_quality)C++14
40 / 100
5010 ms6232 KiB
#include <bits/stdc++.h> #include "quality.h" 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; for( int i=0 ; i + H <= R ; i ++ ){ for( int j=0 ; j + W <= C ; j++ ){ // gore lqvo - i, j std::set< int > S; for( int I = i; I < i + H ; I++ ){ for( int J = j ; J < j + W ; J++ ){ S.insert( Q[I][J] ); } } auto it = S.begin(); std::advance( it, S.size()/2 ); cerr << out( *it ) << endl; 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...