Submission #1011695

# Submission time Handle Problem Language Result Execution time Memory
1011695 2024-07-01T06:29:39 Z u_suck_o Rectangles (IOI19_rect) C++17
37 / 100
5000 ms 28500 KB
#include "bits/stdc++.h"
#include "rect.h"

using namespace std;
int n, m;

long long count_rectangles(vector<vector<int>> a) {
    int cnt = 0;
    n = a.size();
    m = a[0].size();
    for (int t = 1; t < n-1; t++) {
        for (int b = t; b < n-1; b++) {
            for (int l = 1; l < m-1; l++) {
                for (int r = l; r < m-1; r++) {
                    bool valid = true;
                    for (int i = t; i <= b; i++) {
                        for (int j = l; j <= r; j++) {
                            if (a[i][j] >= a[i][l-1]) valid = false;
                            if (a[i][j] >= a[i][r+1]) valid = false;
                            if (a[i][j] >= a[t-1][j]) valid = false;
                            if (a[i][j] >= a[b+1][j]) valid = false;
                            if (!valid) break;
                        }
                        if (!valid) break;
                    }
                    if (valid) cnt++;
                }
            }
        }
    }
    return cnt;
}
# 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 1 ms 344 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 0 ms 432 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 1 ms 428 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 0 ms 348 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 0 ms 432 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 348 KB Output is correct
20 Correct 0 ms 348 KB Output is correct
21 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 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 344 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 0 ms 432 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 1 ms 428 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 0 ms 348 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 0 ms 432 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 348 KB Output is correct
20 Correct 0 ms 348 KB Output is correct
21 Correct 1 ms 348 KB Output is correct
22 Correct 29 ms 348 KB Output is correct
23 Correct 33 ms 348 KB Output is correct
24 Correct 39 ms 344 KB Output is correct
25 Correct 34 ms 344 KB Output is correct
26 Correct 25 ms 348 KB Output is correct
27 Correct 24 ms 344 KB Output is correct
28 Correct 23 ms 348 KB Output is correct
29 Correct 7 ms 488 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 1 ms 344 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 0 ms 432 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 1 ms 428 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 0 ms 348 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 0 ms 432 KB Output is correct
17 Correct 29 ms 348 KB Output is correct
18 Correct 33 ms 348 KB Output is correct
19 Correct 39 ms 344 KB Output is correct
20 Correct 34 ms 344 KB Output is correct
21 Correct 25 ms 348 KB Output is correct
22 Correct 24 ms 344 KB Output is correct
23 Correct 23 ms 348 KB Output is correct
24 Correct 7 ms 488 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 348 KB Output is correct
28 Correct 0 ms 348 KB Output is correct
29 Correct 1 ms 348 KB Output is correct
30 Correct 1210 ms 952 KB Output is correct
31 Correct 1169 ms 860 KB Output is correct
32 Correct 1268 ms 1112 KB Output is correct
33 Correct 786 ms 600 KB Output is correct
34 Correct 1004 ms 880 KB Output is correct
35 Correct 1024 ms 1036 KB Output is correct
36 Correct 1052 ms 1004 KB Output is correct
37 Correct 981 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 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 1 ms 344 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 0 ms 432 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 1 ms 428 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 0 ms 348 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 0 ms 432 KB Output is correct
17 Correct 29 ms 348 KB Output is correct
18 Correct 33 ms 348 KB Output is correct
19 Correct 39 ms 344 KB Output is correct
20 Correct 34 ms 344 KB Output is correct
21 Correct 25 ms 348 KB Output is correct
22 Correct 24 ms 344 KB Output is correct
23 Correct 23 ms 348 KB Output is correct
24 Correct 7 ms 488 KB Output is correct
25 Correct 1210 ms 952 KB Output is correct
26 Correct 1169 ms 860 KB Output is correct
27 Correct 1268 ms 1112 KB Output is correct
28 Correct 786 ms 600 KB Output is correct
29 Correct 1004 ms 880 KB Output is correct
30 Correct 1024 ms 1036 KB Output is correct
31 Correct 1052 ms 1004 KB Output is correct
32 Correct 981 ms 856 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 348 KB Output is correct
36 Correct 0 ms 348 KB Output is correct
37 Correct 1 ms 348 KB Output is correct
38 Execution timed out 5048 ms 7260 KB Time limit exceeded
39 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 13 ms 348 KB Output is correct
2 Correct 8 ms 536 KB Output is correct
3 Correct 6 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 16 ms 556 KB Output is correct
6 Correct 16 ms 348 KB Output is correct
7 Correct 15 ms 440 KB Output is correct
8 Correct 14 ms 344 KB Output is correct
9 Correct 14 ms 348 KB Output is correct
10 Correct 0 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 348 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 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 0 ms 600 KB Output is correct
7 Execution timed out 5050 ms 28500 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 1 ms 344 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 0 ms 432 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 1 ms 428 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 0 ms 348 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 0 ms 432 KB Output is correct
17 Correct 29 ms 348 KB Output is correct
18 Correct 33 ms 348 KB Output is correct
19 Correct 39 ms 344 KB Output is correct
20 Correct 34 ms 344 KB Output is correct
21 Correct 25 ms 348 KB Output is correct
22 Correct 24 ms 344 KB Output is correct
23 Correct 23 ms 348 KB Output is correct
24 Correct 7 ms 488 KB Output is correct
25 Correct 1210 ms 952 KB Output is correct
26 Correct 1169 ms 860 KB Output is correct
27 Correct 1268 ms 1112 KB Output is correct
28 Correct 786 ms 600 KB Output is correct
29 Correct 1004 ms 880 KB Output is correct
30 Correct 1024 ms 1036 KB Output is correct
31 Correct 1052 ms 1004 KB Output is correct
32 Correct 981 ms 856 KB Output is correct
33 Execution timed out 5048 ms 7260 KB Time limit exceeded
34 Halted 0 ms 0 KB -