제출 #250049

#제출 시각아이디문제언어결과실행 시간메모리
250049DavidDamianRectangles (IOI19_rect)C++14
37 / 100
5067 ms28412 KiB
//#include "rect.h" #include<bits/stdc++.h> using namespace std; typedef long long ll; bool check(vector<vector<int> >& board,int a,int b,int c,int d) { //cout<<a<<" "<<b<<" "<<c<<" "<<d<<endl; for(int i=a;i<=b;i++){ for(int j=c;j<=d;j++){ //cout<<i<<" "<<j<<board[i][j]<<endl; if(board[i][c-1]<=board[i][j]) return false; if(board[i][d+1]<=board[i][j]) return false; if(board[a-1][j]<=board[i][j]) return false; if(board[b+1][j]<=board[i][j]) return false; } } return true; } ll count_rectangles(vector<vector<int> > a) { int n=a.size(); int m=a[0].size(); ll total=0; for(int i=1;i<n-1;i++){ for(int j=1;j<m-1;j++){ for(int i2=i;i2<n-1;i2++){ for(int j2=j;j2<m-1;j2++){ if(check(a,i,i2,j,j2)) total++;//cout<<i<<" "<<i2<<" "<<j<<" "<<j2<<endl; } } } } return total; }
#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...