//#include "rect.h"
#include <bits/stdc++.h>
using namespace std;
long long count_rectangles(vector <vector <int> > a){
int n=a.size(),m=a[0].size();
long long ans=0;
for (int r1=1; r1<=n-2; r1++){
for (int r2=r1; r2<=n-2; r2++){
for (int c1=1; c1<=m-2; c1++){
for (int c2=c1; c2<=m-2; c2++){
for (int i=r1; i<=r2; i++){
for (int j=c1; j<=c2; j++){
if (a[i][j]>=a[i][c1-1]||a[i][j]>=a[i][c2+1]||a[i][j]>=a[r1-1][j]||a[i][j]>=a[r2+1][j]) goto die;
}
}
ans++;
die:;
}
}
}
}
return ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Correct |
2 ms |
384 KB |
Output is correct |
3 |
Correct |
2 ms |
364 KB |
Output is correct |
4 |
Correct |
2 ms |
364 KB |
Output is correct |
5 |
Correct |
1 ms |
364 KB |
Output is correct |
6 |
Correct |
2 ms |
364 KB |
Output is correct |
7 |
Correct |
1 ms |
364 KB |
Output is correct |
8 |
Correct |
1 ms |
364 KB |
Output is correct |
9 |
Correct |
2 ms |
364 KB |
Output is correct |
10 |
Correct |
2 ms |
364 KB |
Output is correct |
11 |
Correct |
2 ms |
364 KB |
Output is correct |
12 |
Correct |
2 ms |
364 KB |
Output is correct |
13 |
Correct |
1 ms |
384 KB |
Output is correct |
14 |
Correct |
1 ms |
364 KB |
Output is correct |
15 |
Correct |
1 ms |
364 KB |
Output is correct |
16 |
Correct |
1 ms |
364 KB |
Output is correct |
17 |
Correct |
1 ms |
364 KB |
Output is correct |
18 |
Correct |
1 ms |
364 KB |
Output is correct |
19 |
Correct |
1 ms |
364 KB |
Output is correct |
20 |
Correct |
1 ms |
364 KB |
Output is correct |
21 |
Correct |
1 ms |
364 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Correct |
2 ms |
384 KB |
Output is correct |
3 |
Correct |
2 ms |
364 KB |
Output is correct |
4 |
Correct |
2 ms |
364 KB |
Output is correct |
5 |
Correct |
1 ms |
364 KB |
Output is correct |
6 |
Correct |
2 ms |
364 KB |
Output is correct |
7 |
Correct |
1 ms |
364 KB |
Output is correct |
8 |
Correct |
1 ms |
364 KB |
Output is correct |
9 |
Correct |
2 ms |
364 KB |
Output is correct |
10 |
Correct |
2 ms |
364 KB |
Output is correct |
11 |
Correct |
2 ms |
364 KB |
Output is correct |
12 |
Correct |
2 ms |
364 KB |
Output is correct |
13 |
Correct |
1 ms |
384 KB |
Output is correct |
14 |
Correct |
1 ms |
364 KB |
Output is correct |
15 |
Correct |
1 ms |
364 KB |
Output is correct |
16 |
Correct |
1 ms |
364 KB |
Output is correct |
17 |
Correct |
49 ms |
452 KB |
Output is correct |
18 |
Correct |
55 ms |
472 KB |
Output is correct |
19 |
Correct |
49 ms |
364 KB |
Output is correct |
20 |
Correct |
40 ms |
364 KB |
Output is correct |
21 |
Correct |
48 ms |
364 KB |
Output is correct |
22 |
Correct |
49 ms |
364 KB |
Output is correct |
23 |
Correct |
51 ms |
620 KB |
Output is correct |
24 |
Correct |
12 ms |
364 KB |
Output is correct |
25 |
Correct |
1 ms |
364 KB |
Output is correct |
26 |
Correct |
1 ms |
364 KB |
Output is correct |
27 |
Correct |
1 ms |
364 KB |
Output is correct |
28 |
Correct |
1 ms |
364 KB |
Output is correct |
29 |
Correct |
1 ms |
364 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Correct |
2 ms |
384 KB |
Output is correct |
3 |
Correct |
2 ms |
364 KB |
Output is correct |
4 |
Correct |
2 ms |
364 KB |
Output is correct |
5 |
Correct |
1 ms |
364 KB |
Output is correct |
6 |
Correct |
2 ms |
364 KB |
Output is correct |
7 |
Correct |
1 ms |
364 KB |
Output is correct |
8 |
Correct |
1 ms |
364 KB |
Output is correct |
9 |
Correct |
2 ms |
364 KB |
Output is correct |
10 |
Correct |
2 ms |
364 KB |
Output is correct |
11 |
Correct |
2 ms |
364 KB |
Output is correct |
12 |
Correct |
2 ms |
364 KB |
Output is correct |
13 |
Correct |
1 ms |
384 KB |
Output is correct |
14 |
Correct |
1 ms |
364 KB |
Output is correct |
15 |
Correct |
1 ms |
364 KB |
Output is correct |
16 |
Correct |
1 ms |
364 KB |
Output is correct |
17 |
Correct |
49 ms |
452 KB |
Output is correct |
18 |
Correct |
55 ms |
472 KB |
Output is correct |
19 |
Correct |
49 ms |
364 KB |
Output is correct |
20 |
Correct |
40 ms |
364 KB |
Output is correct |
21 |
Correct |
48 ms |
364 KB |
Output is correct |
22 |
Correct |
49 ms |
364 KB |
Output is correct |
23 |
Correct |
51 ms |
620 KB |
Output is correct |
24 |
Correct |
12 ms |
364 KB |
Output is correct |
25 |
Correct |
1903 ms |
920 KB |
Output is correct |
26 |
Correct |
1865 ms |
920 KB |
Output is correct |
27 |
Correct |
1852 ms |
1000 KB |
Output is correct |
28 |
Correct |
1560 ms |
748 KB |
Output is correct |
29 |
Correct |
1992 ms |
844 KB |
Output is correct |
30 |
Correct |
2073 ms |
876 KB |
Output is correct |
31 |
Correct |
1888 ms |
1004 KB |
Output is correct |
32 |
Correct |
1869 ms |
876 KB |
Output is correct |
33 |
Correct |
1 ms |
364 KB |
Output is correct |
34 |
Correct |
1 ms |
364 KB |
Output is correct |
35 |
Correct |
1 ms |
364 KB |
Output is correct |
36 |
Correct |
1 ms |
364 KB |
Output is correct |
37 |
Correct |
1 ms |
364 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Correct |
2 ms |
384 KB |
Output is correct |
3 |
Correct |
2 ms |
364 KB |
Output is correct |
4 |
Correct |
2 ms |
364 KB |
Output is correct |
5 |
Correct |
1 ms |
364 KB |
Output is correct |
6 |
Correct |
2 ms |
364 KB |
Output is correct |
7 |
Correct |
1 ms |
364 KB |
Output is correct |
8 |
Correct |
1 ms |
364 KB |
Output is correct |
9 |
Correct |
2 ms |
364 KB |
Output is correct |
10 |
Correct |
2 ms |
364 KB |
Output is correct |
11 |
Correct |
2 ms |
364 KB |
Output is correct |
12 |
Correct |
2 ms |
364 KB |
Output is correct |
13 |
Correct |
1 ms |
384 KB |
Output is correct |
14 |
Correct |
1 ms |
364 KB |
Output is correct |
15 |
Correct |
1 ms |
364 KB |
Output is correct |
16 |
Correct |
1 ms |
364 KB |
Output is correct |
17 |
Correct |
49 ms |
452 KB |
Output is correct |
18 |
Correct |
55 ms |
472 KB |
Output is correct |
19 |
Correct |
49 ms |
364 KB |
Output is correct |
20 |
Correct |
40 ms |
364 KB |
Output is correct |
21 |
Correct |
48 ms |
364 KB |
Output is correct |
22 |
Correct |
49 ms |
364 KB |
Output is correct |
23 |
Correct |
51 ms |
620 KB |
Output is correct |
24 |
Correct |
12 ms |
364 KB |
Output is correct |
25 |
Correct |
1903 ms |
920 KB |
Output is correct |
26 |
Correct |
1865 ms |
920 KB |
Output is correct |
27 |
Correct |
1852 ms |
1000 KB |
Output is correct |
28 |
Correct |
1560 ms |
748 KB |
Output is correct |
29 |
Correct |
1992 ms |
844 KB |
Output is correct |
30 |
Correct |
2073 ms |
876 KB |
Output is correct |
31 |
Correct |
1888 ms |
1004 KB |
Output is correct |
32 |
Correct |
1869 ms |
876 KB |
Output is correct |
33 |
Execution timed out |
5050 ms |
7276 KB |
Time limit exceeded |
34 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
15 ms |
492 KB |
Output is correct |
2 |
Correct |
11 ms |
364 KB |
Output is correct |
3 |
Correct |
8 ms |
364 KB |
Output is correct |
4 |
Correct |
1 ms |
364 KB |
Output is correct |
5 |
Correct |
17 ms |
492 KB |
Output is correct |
6 |
Correct |
16 ms |
492 KB |
Output is correct |
7 |
Correct |
16 ms |
492 KB |
Output is correct |
8 |
Correct |
16 ms |
364 KB |
Output is correct |
9 |
Correct |
15 ms |
492 KB |
Output is correct |
10 |
Correct |
1 ms |
364 KB |
Output is correct |
11 |
Correct |
1 ms |
364 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Execution timed out |
5061 ms |
28396 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Correct |
2 ms |
384 KB |
Output is correct |
3 |
Correct |
2 ms |
364 KB |
Output is correct |
4 |
Correct |
2 ms |
364 KB |
Output is correct |
5 |
Correct |
1 ms |
364 KB |
Output is correct |
6 |
Correct |
2 ms |
364 KB |
Output is correct |
7 |
Correct |
1 ms |
364 KB |
Output is correct |
8 |
Correct |
1 ms |
364 KB |
Output is correct |
9 |
Correct |
2 ms |
364 KB |
Output is correct |
10 |
Correct |
2 ms |
364 KB |
Output is correct |
11 |
Correct |
2 ms |
364 KB |
Output is correct |
12 |
Correct |
2 ms |
364 KB |
Output is correct |
13 |
Correct |
1 ms |
384 KB |
Output is correct |
14 |
Correct |
1 ms |
364 KB |
Output is correct |
15 |
Correct |
1 ms |
364 KB |
Output is correct |
16 |
Correct |
1 ms |
364 KB |
Output is correct |
17 |
Correct |
49 ms |
452 KB |
Output is correct |
18 |
Correct |
55 ms |
472 KB |
Output is correct |
19 |
Correct |
49 ms |
364 KB |
Output is correct |
20 |
Correct |
40 ms |
364 KB |
Output is correct |
21 |
Correct |
48 ms |
364 KB |
Output is correct |
22 |
Correct |
49 ms |
364 KB |
Output is correct |
23 |
Correct |
51 ms |
620 KB |
Output is correct |
24 |
Correct |
12 ms |
364 KB |
Output is correct |
25 |
Correct |
1903 ms |
920 KB |
Output is correct |
26 |
Correct |
1865 ms |
920 KB |
Output is correct |
27 |
Correct |
1852 ms |
1000 KB |
Output is correct |
28 |
Correct |
1560 ms |
748 KB |
Output is correct |
29 |
Correct |
1992 ms |
844 KB |
Output is correct |
30 |
Correct |
2073 ms |
876 KB |
Output is correct |
31 |
Correct |
1888 ms |
1004 KB |
Output is correct |
32 |
Correct |
1869 ms |
876 KB |
Output is correct |
33 |
Execution timed out |
5050 ms |
7276 KB |
Time limit exceeded |
34 |
Halted |
0 ms |
0 KB |
- |