This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 ++ ){
std::set< int > S;
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 );
cerr << out( *it ) << endl;
chkmin( nas, *it );
}
}
return nas;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |