Submission #607574

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
6075742022-07-26 20:20:24chonkapopa (BOI18_popa)C++17
0 / 100
21 ms464 KiB
#include<bits/stdc++.h>
#include "popa.h"
using namespace std ;
int query ( int a , int b , int c , int d ) ;
pair < int , int > ranges[ 1007 ] ;
stack < int > s ;
int solve ( int n , int *left , int *right ) {
for ( int i = 0 ; i < n ; ++ i ) {
ranges[ i ] = { i , i } ;
left[ i ] = right[ i ] = -1 ;
}
while ( s.empty ( ) == false ) { s.pop ( ) ; }
s.push ( -1 ) ;
for ( int i = 0 ; i < n ; ++ i ) {
while ( 1 ) {
int aux = s.top ( ) ;
if ( aux >= 0 && query ( aux , i , i , i ) == 1 ) {
s.pop ( ) ;
}
else {
ranges[ i ].first = s.top ( ) + 1 ;
if ( s.top ( ) != -1 ) {
ranges[ s.top ( ) ].second = i ;
}
break ;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...