#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
long long count_rectangles(std::vector<std::vector<int> > a) {
ll cont=0;
ll n=a.size();ll m=a[0].size();
for(int i=0; i<n-1; i++)
{
for(int j=0; j<m-1; j++)
{
for(int k=i+2; k<n; k++)
{
for(int l=j+2; l<m; l++)
{
ll pl=1;
for(int o=i+1; o<k; o++)
{
for(int p=j+1; p<l; p++)
{
if(a[o][p]>=min(min(a[i][p],a[k][p]),min(a[o][j],a[o][l])))
{
pl=0;
goto fin1;
}
}
}
fin1:;
cont+=pl;
}
}
}
}
return cont;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
1 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 |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
1 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 |
348 KB |
Output is correct |
13 |
Correct |
0 ms |
348 KB |
Output is correct |
14 |
Correct |
1 ms |
344 KB |
Output is correct |
15 |
Correct |
1 ms |
348 KB |
Output is correct |
16 |
Correct |
0 ms |
348 KB |
Output is correct |
17 |
Correct |
0 ms |
344 KB |
Output is correct |
18 |
Correct |
0 ms |
344 KB |
Output is correct |
19 |
Correct |
1 ms |
348 KB |
Output is correct |
20 |
Correct |
0 ms |
348 KB |
Output is correct |
21 |
Correct |
0 ms |
344 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
1 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 |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
1 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 |
348 KB |
Output is correct |
13 |
Correct |
0 ms |
348 KB |
Output is correct |
14 |
Correct |
1 ms |
344 KB |
Output is correct |
15 |
Correct |
1 ms |
348 KB |
Output is correct |
16 |
Correct |
0 ms |
348 KB |
Output is correct |
17 |
Correct |
0 ms |
344 KB |
Output is correct |
18 |
Correct |
0 ms |
344 KB |
Output is correct |
19 |
Correct |
1 ms |
348 KB |
Output is correct |
20 |
Correct |
0 ms |
348 KB |
Output is correct |
21 |
Correct |
0 ms |
344 KB |
Output is correct |
22 |
Correct |
29 ms |
348 KB |
Output is correct |
23 |
Correct |
26 ms |
348 KB |
Output is correct |
24 |
Correct |
26 ms |
348 KB |
Output is correct |
25 |
Correct |
22 ms |
348 KB |
Output is correct |
26 |
Correct |
21 ms |
344 KB |
Output is correct |
27 |
Correct |
21 ms |
488 KB |
Output is correct |
28 |
Correct |
21 ms |
348 KB |
Output is correct |
29 |
Correct |
6 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
1 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 |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
1 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 |
348 KB |
Output is correct |
13 |
Correct |
0 ms |
348 KB |
Output is correct |
14 |
Correct |
1 ms |
344 KB |
Output is correct |
15 |
Correct |
1 ms |
348 KB |
Output is correct |
16 |
Correct |
0 ms |
348 KB |
Output is correct |
17 |
Correct |
29 ms |
348 KB |
Output is correct |
18 |
Correct |
26 ms |
348 KB |
Output is correct |
19 |
Correct |
26 ms |
348 KB |
Output is correct |
20 |
Correct |
22 ms |
348 KB |
Output is correct |
21 |
Correct |
21 ms |
344 KB |
Output is correct |
22 |
Correct |
21 ms |
488 KB |
Output is correct |
23 |
Correct |
21 ms |
348 KB |
Output is correct |
24 |
Correct |
6 ms |
348 KB |
Output is correct |
25 |
Correct |
0 ms |
344 KB |
Output is correct |
26 |
Correct |
0 ms |
344 KB |
Output is correct |
27 |
Correct |
1 ms |
348 KB |
Output is correct |
28 |
Correct |
0 ms |
348 KB |
Output is correct |
29 |
Correct |
0 ms |
344 KB |
Output is correct |
30 |
Correct |
1048 ms |
732 KB |
Output is correct |
31 |
Correct |
960 ms |
600 KB |
Output is correct |
32 |
Correct |
987 ms |
732 KB |
Output is correct |
33 |
Correct |
788 ms |
604 KB |
Output is correct |
34 |
Correct |
852 ms |
732 KB |
Output is correct |
35 |
Correct |
902 ms |
732 KB |
Output is correct |
36 |
Correct |
845 ms |
600 KB |
Output is correct |
37 |
Correct |
800 ms |
600 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
1 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 |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
1 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 |
348 KB |
Output is correct |
13 |
Correct |
0 ms |
348 KB |
Output is correct |
14 |
Correct |
1 ms |
344 KB |
Output is correct |
15 |
Correct |
1 ms |
348 KB |
Output is correct |
16 |
Correct |
0 ms |
348 KB |
Output is correct |
17 |
Correct |
29 ms |
348 KB |
Output is correct |
18 |
Correct |
26 ms |
348 KB |
Output is correct |
19 |
Correct |
26 ms |
348 KB |
Output is correct |
20 |
Correct |
22 ms |
348 KB |
Output is correct |
21 |
Correct |
21 ms |
344 KB |
Output is correct |
22 |
Correct |
21 ms |
488 KB |
Output is correct |
23 |
Correct |
21 ms |
348 KB |
Output is correct |
24 |
Correct |
6 ms |
348 KB |
Output is correct |
25 |
Correct |
1048 ms |
732 KB |
Output is correct |
26 |
Correct |
960 ms |
600 KB |
Output is correct |
27 |
Correct |
987 ms |
732 KB |
Output is correct |
28 |
Correct |
788 ms |
604 KB |
Output is correct |
29 |
Correct |
852 ms |
732 KB |
Output is correct |
30 |
Correct |
902 ms |
732 KB |
Output is correct |
31 |
Correct |
845 ms |
600 KB |
Output is correct |
32 |
Correct |
800 ms |
600 KB |
Output is correct |
33 |
Correct |
0 ms |
344 KB |
Output is correct |
34 |
Correct |
0 ms |
344 KB |
Output is correct |
35 |
Correct |
1 ms |
348 KB |
Output is correct |
36 |
Correct |
0 ms |
348 KB |
Output is correct |
37 |
Correct |
0 ms |
344 KB |
Output is correct |
38 |
Execution timed out |
5046 ms |
4188 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 |
348 KB |
Output is correct |
3 |
Correct |
6 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
12 ms |
348 KB |
Output is correct |
6 |
Correct |
9 ms |
348 KB |
Output is correct |
7 |
Correct |
9 ms |
500 KB |
Output is correct |
8 |
Correct |
8 ms |
496 KB |
Output is correct |
9 |
Correct |
8 ms |
348 KB |
Output is correct |
10 |
Correct |
1 ms |
344 KB |
Output is correct |
11 |
Correct |
1 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
344 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 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 |
5088 ms |
22696 KB |
Time limit exceeded |
8 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
1 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 |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
1 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 |
348 KB |
Output is correct |
13 |
Correct |
0 ms |
348 KB |
Output is correct |
14 |
Correct |
1 ms |
344 KB |
Output is correct |
15 |
Correct |
1 ms |
348 KB |
Output is correct |
16 |
Correct |
0 ms |
348 KB |
Output is correct |
17 |
Correct |
29 ms |
348 KB |
Output is correct |
18 |
Correct |
26 ms |
348 KB |
Output is correct |
19 |
Correct |
26 ms |
348 KB |
Output is correct |
20 |
Correct |
22 ms |
348 KB |
Output is correct |
21 |
Correct |
21 ms |
344 KB |
Output is correct |
22 |
Correct |
21 ms |
488 KB |
Output is correct |
23 |
Correct |
21 ms |
348 KB |
Output is correct |
24 |
Correct |
6 ms |
348 KB |
Output is correct |
25 |
Correct |
1048 ms |
732 KB |
Output is correct |
26 |
Correct |
960 ms |
600 KB |
Output is correct |
27 |
Correct |
987 ms |
732 KB |
Output is correct |
28 |
Correct |
788 ms |
604 KB |
Output is correct |
29 |
Correct |
852 ms |
732 KB |
Output is correct |
30 |
Correct |
902 ms |
732 KB |
Output is correct |
31 |
Correct |
845 ms |
600 KB |
Output is correct |
32 |
Correct |
800 ms |
600 KB |
Output is correct |
33 |
Execution timed out |
5046 ms |
4188 KB |
Time limit exceeded |
34 |
Halted |
0 ms |
0 KB |
- |