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 ++ ){
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 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... |