제출 #604065

#제출 시각아이디문제언어결과실행 시간메모리
604065StrawHatWessRectangles (IOI19_rect)C++17
37 / 100
5087 ms28288 KiB
#include "rect.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int>vi; #define pb push_back #define sz(x) (int)x.size() #define all(x) begin(x),end(x) #define FOR(i,a,b) for(int i=a; i<b; i++) //------------------- void ckmax(int &x, int y){x=max(x,y);} int N,M; ll count_rectangles(vector<vi> a) { N=sz(a); M=sz(a[0]); ll ans=0; FOR(i,1,N-1) FOR(j,1,M-1){ FOR(x,i,N-1) FOR(y,j,M-1){ int f=1; FOR(xx,i,x+1){ FOR(yy,j,y+1){ f&=(a[xx][yy]<min(min(a[xx][j-1],a[xx][y+1]),min(a[i-1][yy],a[x+1][yy]))); if(!f) break; } if(!f) break; } ans+=f; } } return ans; } /* 6 5 4 8 7 5 6 7 4 10 3 5 9 7 20 14 2 9 14 7 3 6 5 7 5 2 7 4 5 13 5 6 */
#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...