# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1068968 | RaresFelix | Rectangles (IOI19_rect) | C++17 | 5076 ms | 28292 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 "rect.h"
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
ll count_rectangles(vector<vi> a) {
int n = int(a.size()), m = int(a[0].size());
int re = 0;
for(int x1 = 1; x1 + 1 < n; ++x1)
for(int x2 = x1; x2 + 1 < n; ++x2)
for(int y1 = 1; y1 + 1 < m; ++y1)
for(int y2 = y1; y2 + 1 < m; ++y2) {
int ok = 1;
for(int i = x1; i <= x2; ++i)
for(int j = y1; j <= y2; ++j)
ok &= a[i][j] < a[x1 - 1][j] && a[i][j] < a[x2 + 1][j]
&& a[i][j] < a[i][y1 - 1] && a[i][j] < a[i][y2 + 1];
re += ok;
}
return re;
}
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |