제출 #253568

#제출 시각아이디문제언어결과실행 시간메모리
253568ErkhemkhuuRectangles (IOI19_rect)C++17
37 / 100
5049 ms28368 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define mp make_pair #define F first #define S second const ll N = 5005; bool valid(ll x1, ll y1, ll x2, ll y2, vector <vector <int> > &a) { for(ll i = x1; i <= x2; i++) { for(ll j = y1; j <= y2; j++) { if(a[i][j] >= a[x1 - 1][j]) return false; if(a[i][j] >= a[x2 + 1][j]) return false; if(a[i][j] >= a[i][y1 - 1]) return false; if(a[i][j] >= a[i][y2 + 1]) return false; } } return true; } ll count_rectangles(vector <vector <int> > a) { ll res, i, j, n, m, i1, j1; res = 0; n = a.size(); m = a[0].size(); for(i = 1; i < n - 1; i++) for(j = 1; j < m - 1; j++) for(i1 = i; i1 < n - 1; i1++) for(j1 = j; j1 < m - 1; j1++) res += valid(i, j, i1, j1, a); return res; }
#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...