# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
618466 | chirathnirodha | Rectangles (IOI19_rect) | C++17 | 1 ms | 340 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "rect.h"
#include<bits/stdc++.h>
using namespace std;
long long count_rectangles(vector<vector<int> > a) {
int n=a.size();
int m=a[0].size();
int ans=0;
for(int i=0;i<n;i++){
for(int j=i+2;j<n;j++){
int l=0,r=2;
int curmax[n];
while(l<n && r<n){
int maxi=0;
bool ok=true;
for(int k=i+1;k<=j-1;k++){
if(a[k][r-1]>a[i][r-1] || a[k][r-1]>a[j][r-1]){ok=false;break;}
curmax[k]=max(curmax[k],a[k][r-1]);
if(curmax[k]>a[k][l] || curmax[k]>a[k][r]){ok=false;break;}
}
if(!ok)l=r-1;
else ans++;
r++;
}
}
}
return ans;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |