Submission #143924

#TimeUsernameProblemLanguageResultExecution timeMemory
143924Bodo171Rectangles (IOI19_rect)C++14
10 / 100
12 ms448 KiB
#include "rect.h" #include <vector> using namespace std; vector<vector<int> > a; int n,m,i,j,mx; int solve_n_mic() { int ans=0; if(n<=2) return 0; for(i=1;i<=m-2;i++) { bool bun=(a[1][i]<a[1][i-1]&&a[1][i]<a[0][i]&&a[1][i]<a[2][i]); mx=a[1][i]; for(j=i;j<=m-2;j++) { bun&=(a[1][j]<a[0][j]&&a[1][j]<a[2][j]); mx=max(mx,a[1][j]); if(bun&&mx<a[1][i-1]&&mx<a[1][j+1]) ans++; } } return ans; } long long count_rectangles(vector<vector<int> > att) { a=att; n=a.size();m=a[0].size(); if(n<=3) return solve_n_mic(); return 1; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...