이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std ;
#define pb push_back
#define C continue
#define lb lower_bound
typedef long long ll ;
typedef vector < int > vi ;
#include "rect.h"
int n , m ;
int a [3][2509] ;
long long count_rectangles ( vector <vi> A ) {
n = A .size () ;
m = A [0] .size () ;
for ( int i = 0 ; i < n ; i ++ ) {
for ( int j = 0 ; j < m ; j ++ ) {
a [i][j] = A [i][j] ;
}
}
if ( n <= 2 ) return 0 ;
ll ans = 0 ;
for ( int i = 1 ; i < m - 1 ; i ++ ) {
int mx = 0 ;
for ( int j = i ; j < m -1 ; j ++ ) {
mx = max ( mx , a [1][j] ) ;
if ( min ( a [0][j] , a [2][j] ) <= a [1][j] ) break ;
ans += ( min ( a [1][i-1] , a [1][j+1] ) > mx ) ;
}
}
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... |