제출 #320961

#제출 시각아이디문제언어결과실행 시간메모리
320961daringtriflesQuality Of Living (IOI10_quality)C++17
40 / 100
5061 ms3924 KiB
//control+option+n to run! #include <bits/stdc++.h> using namespace std; #define pb push_back #define ll long long #define pll pair<ll, ll> #define FOR(i, a, b) for (signed long long i = (signed long long)(a); i < (signed long long)(b); i++) #define NEGFOR(i, a, b) for (ll i = (a); i > (b); i--) #define vll vector<long long> #define sll set<long long> #define ld long double #define inf 1000000000000000000 #define mll multiset<long long> #define vpll vector<pll> #define nn << "\n" #define ss << " " #define F(i, b) for (ll i = 0; i < b; i++) //10^8 operations per second //greatest int is 2,147,483,647 //greates long long is 9.22337204e18 //ALL FUNCTIONS SHOULD BE LL!!!! ll power(ll x, ll n, ll m) { assert(n >= 0); x %= m; //note: m*m must be less than 2^63 to avoid ll overflow ll res = 1; while (n > 0) { if (n % 2 == 1) //if n is odd res = res * x % m; x = x * x % m; n /= 2; //divide by two } return res; } ll log(ll base, ll number) { int x = base; int count = 1; while (base < number) { base *= x; count++; } return count; } int rectangle(int r, int c, int h, int w, int p[3001][3001]) { ll ans=inf; FOR(i,0,r-h+1){ FOR(j,0,c-w+1){ vll v; FOR(a,0,h){ FOR(b,0,w){ v.pb(p[a+i][j+b]); // cout<<(p[a+i][j+b]) nn; } } sort(v.begin(),v.end()); ans=min(ans, v[h*w/2]); } } return ans; } /* int q[3001][3001]; #define oi int main() { #ifdef oi ifstream cin("grader.in.0"); ofstream cout("grader.expect.0"); #endif #ifndef oi ios_base::sync_with_stdio(false); cin.tie(NULL); #endif int r, c, h, w; cin >> r >> c >> h >> w; FOR(i, 0, r) { FOR(j, 0, c) { cin >> q[i][j]; } } cout << rectangle(r, c, h, w, q); } */
#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...