# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
1012675 |
2024-07-02T13:38:49 Z |
12345678 |
Rectangles (IOI19_rect) |
C++17 |
|
5000 ms |
28304 KB |
#include "rect.h"
#include <bits/stdc++.h>
using namespace std;
long long count_rectangles(std::vector<std::vector<int> > a) {
int n=a.size(), m=a[0].size();
long long res=0;
for (int r1=1; r1<n-1; r1++)
{
for (int c1=1; c1<m-1; c1++)
{
for (int r2=r1; r2<n-1; r2++)
{
vector<int> mx(n, 0);
for (int c2=c1; c2<m-1; c2++)
{
int tmp=0, f=0;
for (int i=r1; i<=r2; i++) tmp=max(tmp, a[i][c2]), mx[i]=max(mx[i], a[i][c2]);
if (tmp>=a[r1-1][c2]||tmp>=a[r2+1][c2]) break;
for (int i=r1; i<=r2; i++) if (mx[i]>=a[i][c2+1]||mx[i]>=a[i][c1-1]) f=1;
//if (r1==4&&r2==4&&c1==2&&c2==3) cout<<"here "<<mx[r1]<<'\n';
if (!f) res++; //cout<<"debug "<<r1<<' '<<c1<<' '<<r2<<' '<<c2<<'\n';
}
}
}
}
return res;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
432 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
1 ms |
504 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
10 |
Correct |
1 ms |
348 KB |
Output is correct |
11 |
Correct |
1 ms |
348 KB |
Output is correct |
12 |
Correct |
1 ms |
344 KB |
Output is correct |
13 |
Correct |
0 ms |
348 KB |
Output is correct |
14 |
Correct |
0 ms |
348 KB |
Output is correct |
15 |
Correct |
0 ms |
348 KB |
Output is correct |
16 |
Correct |
0 ms |
348 KB |
Output is correct |
17 |
Correct |
0 ms |
432 KB |
Output is correct |
18 |
Correct |
0 ms |
348 KB |
Output is correct |
19 |
Correct |
1 ms |
348 KB |
Output is correct |
20 |
Correct |
0 ms |
344 KB |
Output is correct |
21 |
Correct |
0 ms |
344 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
432 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
1 ms |
504 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
10 |
Correct |
1 ms |
348 KB |
Output is correct |
11 |
Correct |
1 ms |
348 KB |
Output is correct |
12 |
Correct |
1 ms |
344 KB |
Output is correct |
13 |
Correct |
0 ms |
348 KB |
Output is correct |
14 |
Correct |
0 ms |
348 KB |
Output is correct |
15 |
Correct |
0 ms |
348 KB |
Output is correct |
16 |
Correct |
0 ms |
348 KB |
Output is correct |
17 |
Correct |
0 ms |
432 KB |
Output is correct |
18 |
Correct |
0 ms |
348 KB |
Output is correct |
19 |
Correct |
1 ms |
348 KB |
Output is correct |
20 |
Correct |
0 ms |
344 KB |
Output is correct |
21 |
Correct |
0 ms |
344 KB |
Output is correct |
22 |
Correct |
23 ms |
344 KB |
Output is correct |
23 |
Correct |
23 ms |
348 KB |
Output is correct |
24 |
Correct |
23 ms |
344 KB |
Output is correct |
25 |
Correct |
10 ms |
348 KB |
Output is correct |
26 |
Correct |
11 ms |
348 KB |
Output is correct |
27 |
Correct |
10 ms |
348 KB |
Output is correct |
28 |
Correct |
10 ms |
448 KB |
Output is correct |
29 |
Correct |
5 ms |
344 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
432 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
1 ms |
504 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
10 |
Correct |
1 ms |
348 KB |
Output is correct |
11 |
Correct |
1 ms |
348 KB |
Output is correct |
12 |
Correct |
1 ms |
344 KB |
Output is correct |
13 |
Correct |
0 ms |
348 KB |
Output is correct |
14 |
Correct |
0 ms |
348 KB |
Output is correct |
15 |
Correct |
0 ms |
348 KB |
Output is correct |
16 |
Correct |
0 ms |
348 KB |
Output is correct |
17 |
Correct |
23 ms |
344 KB |
Output is correct |
18 |
Correct |
23 ms |
348 KB |
Output is correct |
19 |
Correct |
23 ms |
344 KB |
Output is correct |
20 |
Correct |
10 ms |
348 KB |
Output is correct |
21 |
Correct |
11 ms |
348 KB |
Output is correct |
22 |
Correct |
10 ms |
348 KB |
Output is correct |
23 |
Correct |
10 ms |
448 KB |
Output is correct |
24 |
Correct |
5 ms |
344 KB |
Output is correct |
25 |
Correct |
0 ms |
432 KB |
Output is correct |
26 |
Correct |
0 ms |
348 KB |
Output is correct |
27 |
Correct |
1 ms |
348 KB |
Output is correct |
28 |
Correct |
0 ms |
344 KB |
Output is correct |
29 |
Correct |
0 ms |
344 KB |
Output is correct |
30 |
Correct |
828 ms |
972 KB |
Output is correct |
31 |
Correct |
849 ms |
956 KB |
Output is correct |
32 |
Correct |
832 ms |
1104 KB |
Output is correct |
33 |
Correct |
281 ms |
856 KB |
Output is correct |
34 |
Correct |
288 ms |
884 KB |
Output is correct |
35 |
Correct |
282 ms |
1036 KB |
Output is correct |
36 |
Correct |
290 ms |
1112 KB |
Output is correct |
37 |
Correct |
317 ms |
856 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
432 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
1 ms |
504 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
10 |
Correct |
1 ms |
348 KB |
Output is correct |
11 |
Correct |
1 ms |
348 KB |
Output is correct |
12 |
Correct |
1 ms |
344 KB |
Output is correct |
13 |
Correct |
0 ms |
348 KB |
Output is correct |
14 |
Correct |
0 ms |
348 KB |
Output is correct |
15 |
Correct |
0 ms |
348 KB |
Output is correct |
16 |
Correct |
0 ms |
348 KB |
Output is correct |
17 |
Correct |
23 ms |
344 KB |
Output is correct |
18 |
Correct |
23 ms |
348 KB |
Output is correct |
19 |
Correct |
23 ms |
344 KB |
Output is correct |
20 |
Correct |
10 ms |
348 KB |
Output is correct |
21 |
Correct |
11 ms |
348 KB |
Output is correct |
22 |
Correct |
10 ms |
348 KB |
Output is correct |
23 |
Correct |
10 ms |
448 KB |
Output is correct |
24 |
Correct |
5 ms |
344 KB |
Output is correct |
25 |
Correct |
828 ms |
972 KB |
Output is correct |
26 |
Correct |
849 ms |
956 KB |
Output is correct |
27 |
Correct |
832 ms |
1104 KB |
Output is correct |
28 |
Correct |
281 ms |
856 KB |
Output is correct |
29 |
Correct |
288 ms |
884 KB |
Output is correct |
30 |
Correct |
282 ms |
1036 KB |
Output is correct |
31 |
Correct |
290 ms |
1112 KB |
Output is correct |
32 |
Correct |
317 ms |
856 KB |
Output is correct |
33 |
Correct |
0 ms |
432 KB |
Output is correct |
34 |
Correct |
0 ms |
348 KB |
Output is correct |
35 |
Correct |
1 ms |
348 KB |
Output is correct |
36 |
Correct |
0 ms |
344 KB |
Output is correct |
37 |
Correct |
0 ms |
344 KB |
Output is correct |
38 |
Execution timed out |
5004 ms |
7248 KB |
Time limit exceeded |
39 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
9 ms |
348 KB |
Output is correct |
2 |
Correct |
6 ms |
540 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
1 ms |
348 KB |
Output is correct |
6 |
Correct |
1 ms |
348 KB |
Output is correct |
7 |
Correct |
1 ms |
348 KB |
Output is correct |
8 |
Correct |
1 ms |
348 KB |
Output is correct |
9 |
Correct |
1 ms |
348 KB |
Output is correct |
10 |
Correct |
0 ms |
464 KB |
Output is correct |
11 |
Correct |
1 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
432 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
344 KB |
Output is correct |
5 |
Correct |
0 ms |
344 KB |
Output is correct |
6 |
Correct |
1 ms |
348 KB |
Output is correct |
7 |
Execution timed out |
5074 ms |
28304 KB |
Time limit exceeded |
8 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
432 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
1 ms |
504 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
10 |
Correct |
1 ms |
348 KB |
Output is correct |
11 |
Correct |
1 ms |
348 KB |
Output is correct |
12 |
Correct |
1 ms |
344 KB |
Output is correct |
13 |
Correct |
0 ms |
348 KB |
Output is correct |
14 |
Correct |
0 ms |
348 KB |
Output is correct |
15 |
Correct |
0 ms |
348 KB |
Output is correct |
16 |
Correct |
0 ms |
348 KB |
Output is correct |
17 |
Correct |
23 ms |
344 KB |
Output is correct |
18 |
Correct |
23 ms |
348 KB |
Output is correct |
19 |
Correct |
23 ms |
344 KB |
Output is correct |
20 |
Correct |
10 ms |
348 KB |
Output is correct |
21 |
Correct |
11 ms |
348 KB |
Output is correct |
22 |
Correct |
10 ms |
348 KB |
Output is correct |
23 |
Correct |
10 ms |
448 KB |
Output is correct |
24 |
Correct |
5 ms |
344 KB |
Output is correct |
25 |
Correct |
828 ms |
972 KB |
Output is correct |
26 |
Correct |
849 ms |
956 KB |
Output is correct |
27 |
Correct |
832 ms |
1104 KB |
Output is correct |
28 |
Correct |
281 ms |
856 KB |
Output is correct |
29 |
Correct |
288 ms |
884 KB |
Output is correct |
30 |
Correct |
282 ms |
1036 KB |
Output is correct |
31 |
Correct |
290 ms |
1112 KB |
Output is correct |
32 |
Correct |
317 ms |
856 KB |
Output is correct |
33 |
Execution timed out |
5004 ms |
7248 KB |
Time limit exceeded |
34 |
Halted |
0 ms |
0 KB |
- |