| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 826920 | vjudge1 | Rectangles (IOI19_rect) | C++17 | 9 ms | 344 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<bits/stdc++.h>
#include "rect.h"
using namespace std;
#define all(x) x.begin(), x.end()
#define pb push_back
#define ll long long
#define vout(v) for(int i=0; i<v.size(); i++) cout<<v[i]<<' ';
int a[3000][3000];
long long count_rectangles(vector<vector<int> > S){
int n=S.size(), m=S[0].size();
for(int i=1; i<=n; i++){
for(int j=1; j<=m; j++){
a[i][j] = S[i-1][j-1];
}
}
if(n <= 2 or m <= 2){
return 0;
}
if(n <= 3){
ll ans=0;
for(int i=1; i<m-1; i++){
int mx=a[2][i+1];
int ok = (a[2][i+1] < a[1][i+1] and a[2][i+1] < a[3][i+1]);
for(int j=i+2; j<=m; j++){
if(min(a[2][i], a[2][j]) > mx and ok){
ans++;
}
mx = max(mx, a[2][j]);
ok = (ok and (a[2][j] < a[1][j] and a[2][j] < a[3][j]));
}
}
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... | ||||
