Submission #1045413

# Submission time Handle Problem Language Result Execution time Memory
1045413 2024-08-06T00:15:42 Z vjudge1 Rectangles (IOI19_rect) C++17
13 / 100
390 ms 441700 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];
    grid[0][0]=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 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 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 1 ms 348 KB Output is correct
2 Correct 69 ms 23720 KB Output is correct
3 Correct 149 ms 50516 KB Output is correct
4 Correct 151 ms 50852 KB Output is correct
5 Correct 153 ms 50772 KB Output is correct
6 Correct 197 ms 217936 KB Output is correct
7 Correct 363 ms 414292 KB Output is correct
8 Correct 390 ms 441700 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -