Submission #1021394

# Submission time Handle Problem Language Result Execution time Memory
1021394 2024-07-12T17:31:52 Z vjudge1 Rectangles (IOI19_rect) C++17
37 / 100
5000 ms 25776 KB
#include "rect.h"
#include<bits/stdc++.h>
using namespace std;
using lli=long long int;
#define pb push_back
#define deb(x) cout<<#x<<": "<<x<<endl;

long long count_rectangles(vector<vector<int> > a) {
	lli n=a.size();
	lli m=a[0].size();
	lli ans=0;
	for(lli i=1; i<n-1; ++i){
		for(lli j=i; j<n-1; ++j){
			for(lli k=1; k<m-1; ++k){
				for(lli l=k; l<m-1; ++l){
					bool pos=true;
					for(lli x=i; x<=j; ++x){
						if(!pos) break;
						for(lli y=k; y<=l; ++y){
							if(a[x][y]>=a[i-1][y] || a[x][y]>= a[x][l+1] || a[x][y]>=a[j+1][y] || a[x][y]>=a[x][k-1]){
								pos=false;
								break;
							}
						}
					}
					if(pos) ans++;
				}
			}
		}
	}
	return ans;
}
# 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 348 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 352 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 436 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 432 KB Output is correct
12 Correct 1 ms 348 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 348 KB Output is correct
18 Correct 0 ms 348 KB Output is correct
19 Correct 1 ms 344 KB Output is correct
20 Correct 1 ms 348 KB Output is correct
21 Correct 0 ms 348 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 348 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 352 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 436 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 432 KB Output is correct
12 Correct 1 ms 348 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 348 KB Output is correct
18 Correct 0 ms 348 KB Output is correct
19 Correct 1 ms 344 KB Output is correct
20 Correct 1 ms 348 KB Output is correct
21 Correct 0 ms 348 KB Output is correct
22 Correct 29 ms 348 KB Output is correct
23 Correct 29 ms 348 KB Output is correct
24 Correct 28 ms 348 KB Output is correct
25 Correct 18 ms 348 KB Output is correct
26 Correct 22 ms 480 KB Output is correct
27 Correct 22 ms 348 KB Output is correct
28 Correct 23 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 348 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 0 ms 348 KB Output is correct
6 Correct 1 ms 352 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 436 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 432 KB Output is correct
12 Correct 1 ms 348 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 29 ms 348 KB Output is correct
18 Correct 29 ms 348 KB Output is correct
19 Correct 28 ms 348 KB Output is correct
20 Correct 18 ms 348 KB Output is correct
21 Correct 22 ms 480 KB Output is correct
22 Correct 22 ms 348 KB Output is correct
23 Correct 23 ms 348 KB Output is correct
24 Correct 6 ms 348 KB Output is correct
25 Correct 0 ms 348 KB Output is correct
26 Correct 0 ms 348 KB Output is correct
27 Correct 1 ms 344 KB Output is correct
28 Correct 1 ms 348 KB Output is correct
29 Correct 0 ms 348 KB Output is correct
30 Correct 1186 ms 960 KB Output is correct
31 Correct 1220 ms 856 KB Output is correct
32 Correct 1113 ms 856 KB Output is correct
33 Correct 739 ms 812 KB Output is correct
34 Correct 906 ms 856 KB Output is correct
35 Correct 898 ms 1040 KB Output is correct
36 Correct 872 ms 1000 KB Output is correct
37 Correct 841 ms 1024 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 348 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 352 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 436 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 432 KB Output is correct
12 Correct 1 ms 348 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 29 ms 348 KB Output is correct
18 Correct 29 ms 348 KB Output is correct
19 Correct 28 ms 348 KB Output is correct
20 Correct 18 ms 348 KB Output is correct
21 Correct 22 ms 480 KB Output is correct
22 Correct 22 ms 348 KB Output is correct
23 Correct 23 ms 348 KB Output is correct
24 Correct 6 ms 348 KB Output is correct
25 Correct 1186 ms 960 KB Output is correct
26 Correct 1220 ms 856 KB Output is correct
27 Correct 1113 ms 856 KB Output is correct
28 Correct 739 ms 812 KB Output is correct
29 Correct 906 ms 856 KB Output is correct
30 Correct 898 ms 1040 KB Output is correct
31 Correct 872 ms 1000 KB Output is correct
32 Correct 841 ms 1024 KB Output is correct
33 Correct 0 ms 348 KB Output is correct
34 Correct 0 ms 348 KB Output is correct
35 Correct 1 ms 344 KB Output is correct
36 Correct 1 ms 348 KB Output is correct
37 Correct 0 ms 348 KB Output is correct
38 Execution timed out 5051 ms 7260 KB Time limit exceeded
39 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 10 ms 348 KB Output is correct
2 Correct 7 ms 348 KB Output is correct
3 Correct 4 ms 604 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 10 ms 348 KB Output is correct
6 Correct 10 ms 344 KB Output is correct
7 Correct 10 ms 348 KB Output is correct
8 Correct 9 ms 504 KB Output is correct
9 Correct 9 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 1 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 344 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 432 KB Output is correct
7 Execution timed out 5078 ms 25776 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 348 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 352 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 436 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 432 KB Output is correct
12 Correct 1 ms 348 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 29 ms 348 KB Output is correct
18 Correct 29 ms 348 KB Output is correct
19 Correct 28 ms 348 KB Output is correct
20 Correct 18 ms 348 KB Output is correct
21 Correct 22 ms 480 KB Output is correct
22 Correct 22 ms 348 KB Output is correct
23 Correct 23 ms 348 KB Output is correct
24 Correct 6 ms 348 KB Output is correct
25 Correct 1186 ms 960 KB Output is correct
26 Correct 1220 ms 856 KB Output is correct
27 Correct 1113 ms 856 KB Output is correct
28 Correct 739 ms 812 KB Output is correct
29 Correct 906 ms 856 KB Output is correct
30 Correct 898 ms 1040 KB Output is correct
31 Correct 872 ms 1000 KB Output is correct
32 Correct 841 ms 1024 KB Output is correct
33 Execution timed out 5051 ms 7260 KB Time limit exceeded
34 Halted 0 ms 0 KB -