# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
481652 | 2021-10-21T09:44:07 Z | SlavicG | Quality Of Living (IOI10_quality) | C++17 | 2 ms | 332 KB |
#include"quality.h" #include "bits/stdc++.h" using namespace std; #define ll long long #define forn(i,n) for(int i=0;i<n;i++) #define all(v) v.begin(), v.end() #define rall(v) v.rbegin(),v.rend() #define pb push_back #define sz(a) (int)a.size() const int N = 3001; int rectangle(int n, int m, int a, int b, int c[3001][3001]){ int ans = INT_MAX; for(int i = 0;i + a < n;++i){ for(int j = 0;j + b < m;++j){ int l = 1, r = n * m; while(l <= r){ int mid = l + r >> 1; int cnt_smaller = 0, cnt_greater = 0; for(int x = i;x < i + a;++x){ for(int y = j;y < j + b;++y){ if(c[x][y] < mid)++cnt_smaller; else if(c[x][y] > mid)++cnt_greater; } } if(cnt_smaller == cnt_greater){ ans = min(ans, cnt_smaller); r = mid - 1; }else if(cnt_smaller > cnt_greater){ r = mid - 1; }else l = mid + 1; } } } return ans; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 332 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 332 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 332 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 332 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 332 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |