Submission #418186

# Submission time Handle Problem Language Result Execution time Memory
418186 2021-06-05T07:49:46 Z tgehr Rectangles (IOI19_rect) C++14
18 / 100
5000 ms 28280 KB
#include "rect.h"

long long count_rectangles(std::vector<std::vector<int> > a) {
	int n=a.size(), m=a[0].size();
	long long r=0;
	for(int r_1=1;r_1<n-1;r_1++){
		for(int r_2=r_1;r_2<n-1;r_2++){
			for(int c_1=1;c_1<m-1;c_1++){
				for(int c_2=c_1;c_2<m-1;c_2++){
					bool ok=true;
					for(int i=r_1;i<=r_2;i++){
						for(int j=c_1;j<=c_2;j++){
							ok&=a[i][j]<a[r_1-1][j];
							ok&=a[i][j]<a[r_2+1][j];
							ok&=a[i][j]<a[i][c_1-1];
							ok&=a[i][j]<a[i][c_2+1];
						}
					}
					r+=ok;
				}
			}
		}
	}
	return r;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 35 ms 204 KB Output is correct
3 Correct 35 ms 204 KB Output is correct
4 Correct 36 ms 204 KB Output is correct
5 Correct 51 ms 272 KB Output is correct
6 Correct 50 ms 280 KB Output is correct
7 Correct 3 ms 204 KB Output is correct
8 Correct 2 ms 204 KB Output is correct
9 Correct 35 ms 264 KB Output is correct
10 Correct 37 ms 204 KB Output is correct
11 Correct 35 ms 260 KB Output is correct
12 Correct 35 ms 264 KB Output is correct
13 Correct 1 ms 268 KB Output is correct
14 Correct 1 ms 204 KB Output is correct
15 Correct 1 ms 204 KB Output is correct
16 Correct 0 ms 204 KB Output is correct
17 Correct 0 ms 204 KB Output is correct
18 Correct 0 ms 204 KB Output is correct
19 Correct 35 ms 276 KB Output is correct
20 Correct 4 ms 204 KB Output is correct
21 Correct 0 ms 280 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 35 ms 204 KB Output is correct
3 Correct 35 ms 204 KB Output is correct
4 Correct 36 ms 204 KB Output is correct
5 Correct 51 ms 272 KB Output is correct
6 Correct 50 ms 280 KB Output is correct
7 Correct 3 ms 204 KB Output is correct
8 Correct 2 ms 204 KB Output is correct
9 Correct 35 ms 264 KB Output is correct
10 Correct 37 ms 204 KB Output is correct
11 Correct 35 ms 260 KB Output is correct
12 Correct 35 ms 264 KB Output is correct
13 Correct 1 ms 268 KB Output is correct
14 Correct 1 ms 204 KB Output is correct
15 Correct 1 ms 204 KB Output is correct
16 Correct 0 ms 204 KB Output is correct
17 Correct 0 ms 204 KB Output is correct
18 Correct 0 ms 204 KB Output is correct
19 Correct 35 ms 276 KB Output is correct
20 Correct 4 ms 204 KB Output is correct
21 Correct 0 ms 280 KB Output is correct
22 Execution timed out 5048 ms 332 KB Time limit exceeded
23 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 35 ms 204 KB Output is correct
3 Correct 35 ms 204 KB Output is correct
4 Correct 36 ms 204 KB Output is correct
5 Correct 51 ms 272 KB Output is correct
6 Correct 50 ms 280 KB Output is correct
7 Correct 3 ms 204 KB Output is correct
8 Correct 2 ms 204 KB Output is correct
9 Correct 35 ms 264 KB Output is correct
10 Correct 37 ms 204 KB Output is correct
11 Correct 35 ms 260 KB Output is correct
12 Correct 35 ms 264 KB Output is correct
13 Correct 1 ms 268 KB Output is correct
14 Correct 1 ms 204 KB Output is correct
15 Correct 1 ms 204 KB Output is correct
16 Correct 0 ms 204 KB Output is correct
17 Execution timed out 5048 ms 332 KB Time limit exceeded
18 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 35 ms 204 KB Output is correct
3 Correct 35 ms 204 KB Output is correct
4 Correct 36 ms 204 KB Output is correct
5 Correct 51 ms 272 KB Output is correct
6 Correct 50 ms 280 KB Output is correct
7 Correct 3 ms 204 KB Output is correct
8 Correct 2 ms 204 KB Output is correct
9 Correct 35 ms 264 KB Output is correct
10 Correct 37 ms 204 KB Output is correct
11 Correct 35 ms 260 KB Output is correct
12 Correct 35 ms 264 KB Output is correct
13 Correct 1 ms 268 KB Output is correct
14 Correct 1 ms 204 KB Output is correct
15 Correct 1 ms 204 KB Output is correct
16 Correct 0 ms 204 KB Output is correct
17 Execution timed out 5048 ms 332 KB Time limit exceeded
18 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 4574 ms 376 KB Output is correct
2 Correct 2777 ms 372 KB Output is correct
3 Correct 4572 ms 336 KB Output is correct
4 Correct 0 ms 204 KB Output is correct
5 Correct 4535 ms 376 KB Output is correct
6 Correct 4502 ms 380 KB Output is correct
7 Correct 4527 ms 376 KB Output is correct
8 Correct 4556 ms 360 KB Output is correct
9 Correct 4547 ms 480 KB Output is correct
10 Correct 1 ms 308 KB Output is correct
11 Correct 1 ms 332 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 35 ms 276 KB Output is correct
4 Correct 4 ms 204 KB Output is correct
5 Correct 0 ms 280 KB Output is correct
6 Correct 1 ms 276 KB Output is correct
7 Execution timed out 5073 ms 28280 KB Time limit exceeded
8 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 35 ms 204 KB Output is correct
3 Correct 35 ms 204 KB Output is correct
4 Correct 36 ms 204 KB Output is correct
5 Correct 51 ms 272 KB Output is correct
6 Correct 50 ms 280 KB Output is correct
7 Correct 3 ms 204 KB Output is correct
8 Correct 2 ms 204 KB Output is correct
9 Correct 35 ms 264 KB Output is correct
10 Correct 37 ms 204 KB Output is correct
11 Correct 35 ms 260 KB Output is correct
12 Correct 35 ms 264 KB Output is correct
13 Correct 1 ms 268 KB Output is correct
14 Correct 1 ms 204 KB Output is correct
15 Correct 1 ms 204 KB Output is correct
16 Correct 0 ms 204 KB Output is correct
17 Execution timed out 5048 ms 332 KB Time limit exceeded
18 Halted 0 ms 0 KB -