Submission #297404

#TimeUsernameProblemLanguageResultExecution timeMemory
297404infinite_iqRectangles (IOI19_rect)C++14
10 / 100
7 ms512 KiB
#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 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...