Submission #286989

#TimeUsernameProblemLanguageResultExecution timeMemory
286989MasterTasterQuality Of Living (IOI10_quality)C++14
40 / 100
5066 ms3076 KiB
#include "quality.h"
#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;

int rectangle(int R, int C, int H, int W, int Q[3001][3001])
{
    int ress=R*C+1;
    for (int i=0; i<=R-H; i++)
    {
        for (int j=0; j<=C-W; j++)
        {
            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)

quality.cpp:16:38: warning: 'ans' defined but not used [-Wunused-variable]
   16 | static int R,C,H,W,Q[3001][3001],i,j,ans;
      |                                      ^~~
quality.cpp:16:36: warning: 'j' defined but not used [-Wunused-variable]
   16 | static int R,C,H,W,Q[3001][3001],i,j,ans;
      |                                    ^
quality.cpp:16:34: warning: 'i' defined but not used [-Wunused-variable]
   16 | static int R,C,H,W,Q[3001][3001],i,j,ans;
      |                                  ^
quality.cpp:16:20: warning: 'Q' defined but not used [-Wunused-variable]
   16 | static int R,C,H,W,Q[3001][3001],i,j,ans;
      |                    ^
quality.cpp:16:18: warning: 'W' defined but not used [-Wunused-variable]
   16 | static int R,C,H,W,Q[3001][3001],i,j,ans;
      |                  ^
quality.cpp:16:16: warning: 'H' defined but not used [-Wunused-variable]
   16 | static int R,C,H,W,Q[3001][3001],i,j,ans;
      |                ^
quality.cpp:16:14: warning: 'C' defined but not used [-Wunused-variable]
   16 | static int R,C,H,W,Q[3001][3001],i,j,ans;
      |              ^
quality.cpp:16:12: warning: 'R' defined but not used [-Wunused-variable]
   16 | static int R,C,H,W,Q[3001][3001],i,j,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...