이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "rect.h"
#include <cassert>
#include <iostream>
#include <set>
#include <queue>
#include <stack>
#include <iterator>
#include <cmath>
#include <algorithm>
#include <vector>
#include <map>
#include <cstdio>
#define rep(i,a,b) for(int i = a; i<b; i++)
#define per(i,a,b) for(int i = a; i>=b; i--)
#define pb push_back
#define se second
using namespace std;
long long count_rectangles(std::vector<std::vector<int> > a) {
int n = a.size()-1;
int m = a[0].size()-1;
long long ans = 0;
rep(i,1,n){
rep(j,1,m){
rep(ii,i,n){
rep(jj,j,m){
bool f = 1;
rep(k,i,ii+1){
rep(l,j,jj+1){
if(a[k][l]>=a[k][j-1]||a[k][l]>=a[k][jj+1]||a[k][l]>=a[i-1][l]||a[k][l]>=a[ii+1][l]){
f = 0;
break;
}
}
if(!f)break;
}
if(f)ans++;
}
}
}
}
return ans;
}
# | 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... |