Submission #243343

#TimeUsernameProblemLanguageResultExecution timeMemory
243343Dremix10Quality Of Living (IOI10_quality)C++17
40 / 100
5062 ms2432 KiB
#include "quality.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef pair<int,int> pi;
typedef pair<ll,ll> pl;
#define F first
#define S second
#define endl '\n'
#define p(x) cerr<<#x<<" = "<<x<<endl;
#define p2(x,y) cerr<<#x<<" , "<<#y<<" = "<<x<<" , "<<y<<endl;
#define pp(x) cerr<<#x<<" = ("<<x.F<<" , "<<x.S<<")"<<endl;
#define pv(x) cerr<<#x<<" = {";for(auto u : x)cerr<<u<<", ";cerr<<"}"<<endl;
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define maxp 22
#define EPS (ld)(1e-18)
#define mod (int)(1e9+7)
#define N (int)(1e5+1)

int rectangle(int n, int m, int h, int w, int arr[3001][3001]) {
    int i,j,k,l;
    int ans=n*m;

    for(i=0;i<n-h+1;i++)
    for(j=0;j<m-w+1;j++){
        int num[h*w];
        int pos=0;

        for(k=0;k<h;k++)
            for(l=0;l<w;l++)
            num[pos++]=arr[i+k][j+l];

        sort(num,num+h*w);
        ans=min(ans,num[h*w/2]);
    }
    return ans;
}
#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...