# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
481659 | 2021-10-21T09:49:51 Z | SlavicG | Quality Of Living (IOI10_quality) | C++17 | 5000 ms | 2252 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 - 1 < n;++i){ for(int j = 0;j + b - 1 < 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, mid); 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 | Correct | 2 ms | 332 KB | Output is correct |
2 | Correct | 1 ms | 332 KB | Output is correct |
3 | Correct | 0 ms | 332 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 332 KB | Output is correct |
2 | Correct | 1 ms | 332 KB | Output is correct |
3 | Correct | 0 ms | 332 KB | Output is correct |
4 | Correct | 183 ms | 764 KB | Output is correct |
5 | Correct | 170 ms | 760 KB | Output is correct |
6 | Correct | 109 ms | 716 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 332 KB | Output is correct |
2 | Correct | 1 ms | 332 KB | Output is correct |
3 | Correct | 0 ms | 332 KB | Output is correct |
4 | Correct | 183 ms | 764 KB | Output is correct |
5 | Correct | 170 ms | 760 KB | Output is correct |
6 | Correct | 109 ms | 716 KB | Output is correct |
7 | Execution timed out | 5075 ms | 2252 KB | Time limit exceeded |
8 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 332 KB | Output is correct |
2 | Correct | 1 ms | 332 KB | Output is correct |
3 | Correct | 0 ms | 332 KB | Output is correct |
4 | Correct | 183 ms | 764 KB | Output is correct |
5 | Correct | 170 ms | 760 KB | Output is correct |
6 | Correct | 109 ms | 716 KB | Output is correct |
7 | Execution timed out | 5075 ms | 2252 KB | Time limit exceeded |
8 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 332 KB | Output is correct |
2 | Correct | 1 ms | 332 KB | Output is correct |
3 | Correct | 0 ms | 332 KB | Output is correct |
4 | Correct | 183 ms | 764 KB | Output is correct |
5 | Correct | 170 ms | 760 KB | Output is correct |
6 | Correct | 109 ms | 716 KB | Output is correct |
7 | Execution timed out | 5075 ms | 2252 KB | Time limit exceeded |
8 | Halted | 0 ms | 0 KB | - |