# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
1045412 |
2024-08-06T00:13:42 Z |
vjudge1 |
Rectangles (IOI19_rect) |
C++17 |
|
381 ms |
454020 KB |
#include "rect.h"
#include<bits/stdc++.h>
using namespace std;
bitset<85> ok[85][85][85];
bitset<2510>grid[2510];
int mnl,mnr,mxl,mxr,cnt;
void flod(int i,int j,int n,int m){
if(i<0||j<0||i>n+1||j>m+1)
return;
if(grid[i][j])
return;
grid[i][j]=1;
cnt++;
mnr=min(mnr,i);
mxr=max(mxr,i);
mnl=min(mnl,j);
mxl=max(mxl,j);
flod(i,j-1,n,m);
flod(i,j+1,n,m);
flod(i-1,j,n,m);
flod(i+1,j,n,m);
}
long long count_rectangles(std::vector<std::vector<int> > a) {
int n=a.size(),m=a[0].size();
for(int i=1;i<=n;i++)
for(int j=1;j<=m;j++)
grid[i][j]=a[i-1][j-1];
int ans=0;
for(int i=1;i<=n;i++)
for(int j=1;j<=m;j++){
mxr=mnr=i;
mnl=mxl=j;
cnt=0;
flod(i,j,n,m);
ans+=(mxr-mnr+1)*(mxl-mnl+1)==cnt;
}
return ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
68 ms |
23676 KB |
Output is correct |
3 |
Correct |
153 ms |
62728 KB |
Output is correct |
4 |
Correct |
154 ms |
63060 KB |
Output is correct |
5 |
Correct |
168 ms |
63060 KB |
Output is correct |
6 |
Correct |
184 ms |
224080 KB |
Output is correct |
7 |
Correct |
365 ms |
425884 KB |
Output is correct |
8 |
Correct |
381 ms |
454020 KB |
Output is correct |
9 |
Correct |
0 ms |
348 KB |
Output is correct |
10 |
Correct |
1 ms |
344 KB |
Output is correct |
11 |
Correct |
0 ms |
348 KB |
Output is correct |
12 |
Correct |
0 ms |
348 KB |
Output is correct |
13 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
14 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |