# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
1000956 |
2024-06-18T11:53:18 Z |
irmuun |
Rectangles (IOI19_rect) |
C++17 |
|
5000 ms |
28316 KB |
#include<bits/stdc++.h>
#include "rect.h"
using namespace std;
#define ll long long
#define pb push_back
#define ff first
#define ss second
#define all(s) s.begin(),s.end()
#define rall(s) s.rbegin(),s.rend()
ll count_rectangles(vector<vector<int>>a){
ll ans=0;
int n=a.size(),m=a[0].size();
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++){
bool ok=true;
for(int i=r1;i<=r2;i++){
for(int j=c1;j<=c2;j++){
if(a[i][j]>=min({a[r1-1][j],a[r2+1][j],a[i][c1-1],a[i][c2+1]})){
ok=false;
}
}
}
if(ok){
ans++;
}
}
}
}
}
return ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
21 ms |
344 KB |
Output is correct |
3 |
Correct |
31 ms |
348 KB |
Output is correct |
4 |
Correct |
19 ms |
444 KB |
Output is correct |
5 |
Correct |
31 ms |
348 KB |
Output is correct |
6 |
Correct |
19 ms |
440 KB |
Output is correct |
7 |
Correct |
2 ms |
348 KB |
Output is correct |
8 |
Correct |
1 ms |
432 KB |
Output is correct |
9 |
Correct |
22 ms |
348 KB |
Output is correct |
10 |
Correct |
19 ms |
440 KB |
Output is correct |
11 |
Correct |
21 ms |
420 KB |
Output is correct |
12 |
Correct |
19 ms |
344 KB |
Output is correct |
13 |
Correct |
0 ms |
348 KB |
Output is correct |
14 |
Correct |
0 ms |
432 KB |
Output is correct |
15 |
Correct |
1 ms |
348 KB |
Output is correct |
16 |
Correct |
1 ms |
348 KB |
Output is correct |
17 |
Correct |
0 ms |
348 KB |
Output is correct |
18 |
Correct |
0 ms |
428 KB |
Output is correct |
19 |
Correct |
31 ms |
348 KB |
Output is correct |
20 |
Correct |
4 ms |
444 KB |
Output is correct |
21 |
Correct |
0 ms |
604 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
21 ms |
344 KB |
Output is correct |
3 |
Correct |
31 ms |
348 KB |
Output is correct |
4 |
Correct |
19 ms |
444 KB |
Output is correct |
5 |
Correct |
31 ms |
348 KB |
Output is correct |
6 |
Correct |
19 ms |
440 KB |
Output is correct |
7 |
Correct |
2 ms |
348 KB |
Output is correct |
8 |
Correct |
1 ms |
432 KB |
Output is correct |
9 |
Correct |
22 ms |
348 KB |
Output is correct |
10 |
Correct |
19 ms |
440 KB |
Output is correct |
11 |
Correct |
21 ms |
420 KB |
Output is correct |
12 |
Correct |
19 ms |
344 KB |
Output is correct |
13 |
Correct |
0 ms |
348 KB |
Output is correct |
14 |
Correct |
0 ms |
432 KB |
Output is correct |
15 |
Correct |
1 ms |
348 KB |
Output is correct |
16 |
Correct |
1 ms |
348 KB |
Output is correct |
17 |
Correct |
0 ms |
348 KB |
Output is correct |
18 |
Correct |
0 ms |
428 KB |
Output is correct |
19 |
Correct |
31 ms |
348 KB |
Output is correct |
20 |
Correct |
4 ms |
444 KB |
Output is correct |
21 |
Correct |
0 ms |
604 KB |
Output is correct |
22 |
Execution timed out |
5077 ms |
604 KB |
Time limit exceeded |
23 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
21 ms |
344 KB |
Output is correct |
3 |
Correct |
31 ms |
348 KB |
Output is correct |
4 |
Correct |
19 ms |
444 KB |
Output is correct |
5 |
Correct |
31 ms |
348 KB |
Output is correct |
6 |
Correct |
19 ms |
440 KB |
Output is correct |
7 |
Correct |
2 ms |
348 KB |
Output is correct |
8 |
Correct |
1 ms |
432 KB |
Output is correct |
9 |
Correct |
22 ms |
348 KB |
Output is correct |
10 |
Correct |
19 ms |
440 KB |
Output is correct |
11 |
Correct |
21 ms |
420 KB |
Output is correct |
12 |
Correct |
19 ms |
344 KB |
Output is correct |
13 |
Correct |
0 ms |
348 KB |
Output is correct |
14 |
Correct |
0 ms |
432 KB |
Output is correct |
15 |
Correct |
1 ms |
348 KB |
Output is correct |
16 |
Correct |
1 ms |
348 KB |
Output is correct |
17 |
Execution timed out |
5077 ms |
604 KB |
Time limit exceeded |
18 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
21 ms |
344 KB |
Output is correct |
3 |
Correct |
31 ms |
348 KB |
Output is correct |
4 |
Correct |
19 ms |
444 KB |
Output is correct |
5 |
Correct |
31 ms |
348 KB |
Output is correct |
6 |
Correct |
19 ms |
440 KB |
Output is correct |
7 |
Correct |
2 ms |
348 KB |
Output is correct |
8 |
Correct |
1 ms |
432 KB |
Output is correct |
9 |
Correct |
22 ms |
348 KB |
Output is correct |
10 |
Correct |
19 ms |
440 KB |
Output is correct |
11 |
Correct |
21 ms |
420 KB |
Output is correct |
12 |
Correct |
19 ms |
344 KB |
Output is correct |
13 |
Correct |
0 ms |
348 KB |
Output is correct |
14 |
Correct |
0 ms |
432 KB |
Output is correct |
15 |
Correct |
1 ms |
348 KB |
Output is correct |
16 |
Correct |
1 ms |
348 KB |
Output is correct |
17 |
Execution timed out |
5077 ms |
604 KB |
Time limit exceeded |
18 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2497 ms |
532 KB |
Output is correct |
2 |
Correct |
1591 ms |
344 KB |
Output is correct |
3 |
Correct |
2529 ms |
344 KB |
Output is correct |
4 |
Correct |
0 ms |
344 KB |
Output is correct |
5 |
Correct |
2544 ms |
532 KB |
Output is correct |
6 |
Correct |
2669 ms |
532 KB |
Output is correct |
7 |
Correct |
2561 ms |
344 KB |
Output is correct |
8 |
Correct |
2605 ms |
512 KB |
Output is correct |
9 |
Correct |
2676 ms |
532 KB |
Output is correct |
10 |
Correct |
1 ms |
344 KB |
Output is correct |
11 |
Correct |
0 ms |
444 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
428 KB |
Output is correct |
3 |
Correct |
31 ms |
348 KB |
Output is correct |
4 |
Correct |
4 ms |
444 KB |
Output is correct |
5 |
Correct |
0 ms |
604 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Execution timed out |
5079 ms |
28316 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 |
21 ms |
344 KB |
Output is correct |
3 |
Correct |
31 ms |
348 KB |
Output is correct |
4 |
Correct |
19 ms |
444 KB |
Output is correct |
5 |
Correct |
31 ms |
348 KB |
Output is correct |
6 |
Correct |
19 ms |
440 KB |
Output is correct |
7 |
Correct |
2 ms |
348 KB |
Output is correct |
8 |
Correct |
1 ms |
432 KB |
Output is correct |
9 |
Correct |
22 ms |
348 KB |
Output is correct |
10 |
Correct |
19 ms |
440 KB |
Output is correct |
11 |
Correct |
21 ms |
420 KB |
Output is correct |
12 |
Correct |
19 ms |
344 KB |
Output is correct |
13 |
Correct |
0 ms |
348 KB |
Output is correct |
14 |
Correct |
0 ms |
432 KB |
Output is correct |
15 |
Correct |
1 ms |
348 KB |
Output is correct |
16 |
Correct |
1 ms |
348 KB |
Output is correct |
17 |
Execution timed out |
5077 ms |
604 KB |
Time limit exceeded |
18 |
Halted |
0 ms |
0 KB |
- |