# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
287003 | MasterTaster | 삶의 질 (IOI10_quality) | C++14 | 5052 ms | 2560 KiB |
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 <stdio.h>
#include <stdlib.h>
#include "quality.h"
using namespace std;
#define ll long long
#define pb push_back
#define pii pair<int, int>
#define xx first
#define yy second
#define endl "\n"
static int R,C,H,W,Q[3001][3001],i,j,ans;
pair<int, int> pos[90010];
int rectangle(int R, int C, int H, int W, int Q[3001][3001])
{
int ress=R*C+1;
int koji=H*W/2+1;
for (int i=0; i<R; i++) for (int j=0; j<C; j++) pos[Q[i][j]]={i, j};
for (int i=0; i<=R-H; i++)
{
for (int j=0; j<=C-W; j++)
{
int koliko=0;
for (int k=1; k<=R*C; k++)
{
if (pos[k].xx>=i && pos[k].xx<i+H && pos[k].yy>=j && pos[k].yy<j+W) koliko++;
if (koliko==koji)
{
//cout<<i<<" "<<j<<" "<<k<<endl;
ress=min(ress, k);
break;
}
}
/*vector<int> koji;
for (int x=i; x<i+H; x++)
{
for (int y=j; y<j+W; y++)
koji.pb(Q[x][y]);
}
sort(koji.begin(), koji.end());
//cout<<i<<" "<<j<<" "<<koji[koji.size()/2]<<endl;
ress=min(ress, koji[koji.size()/2]);*/
}
}
return ress;
//return 1;
}
Compilation message (stderr)
# | 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... |