Submission #835646

# Submission time Handle Problem Language Result Execution time Memory
835646 2023-08-23T17:08:27 Z lollipop Radio Towers (IOI22_towers) C++17
60 / 100
1081 ms 27692 KB
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/rope>
//#define ll long long
//#define int long long
#define pb push_back
#define s second
#define f first
#define pf push_front
#define inf 1000000000000000
#define bitebi __builtin_popcountll
#define FOR( i , n ) for( int i = 0 ; i < n ; i ++ )
#define YES cout <<"YES\n"
#define NO cout << "NO\n"
#define debug cout << "Here Fine" << endl ;
#define pr pair < int , int >
#define fbo find_by_order // returns iterator
#define ook order_of_key // returns strictly less numbers than key
using namespace std ;
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
using namespace __gnu_pbds;
using namespace __gnu_cxx;
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
const double Pi=acos(-1.0);
const double EPS=1E-8;
const int mod =  1000000007 ;
const int mod1 = 998244353 ;
const int N = 4e5 + 10 ;
//mt19937 R(time(0));
map < string , int > ma , ma1 ;

#include "towers.h"


// first type of segment tree 
struct stu{
	int mn , mx , val , val1 , pos ; 
};
stu node[ 4 * N ] , xx ;
int a[ N ] , n ; 

stu combine( stu a , stu b ){
	stu c ; c.mx = max( a.mx , b.mx ) ;
	c.mn = min( a.mn , b.mn ) ;
	c.val = max( { a.val , b.val , b.mx - a.mn } ) ;
	c.val1 = max( { a.val1 , b.val1 , a.mx - b.mn } ) ;
	if( a.mn < b.mn ) c.pos = a.pos ;
	else c.pos = b.pos ; 
	return c ; 
}
void build( int v , int vl , int vr ){
	if( vl == vr ){
		node[ v ] = { a[ vl ] , a[ vl ] , 0 , 0 , vl } ;
		return ;
	}
	int vm = ( vl + vr ) / 2 ;
	build( v + v , vl , vm ) ;
	build( v + v + 1 , vm + 1 , vr ) ;
	node[ v ] = combine( node[ v + v ] , node[ v + v + 1 ] ) ;
}
stu get_df( int v , int vl , int vr , int l , int r ){
	if( l > r ) return xx ;
	if( vl == l && vr == r ) return node[ v ] ;
	int vm = ( vl + vr ) / 2 ;
	stu a , b ;
	a = get_df( v + v , vl , vm , l , min( r , vm ) ) ;
	b = get_df( v + v + 1 , vm + 1 , vr , max( l , vm + 1 ) , r ) ;
	return combine( a , b ) ;  
}
int get_clos( int v , int vl , int vr , int l , int r , int val , int nd ){
	if( l > r ) return -1 ;	
	if( node[ v ].mx < val ) return -1 ;
	if( vl == vr ) return vl ; 
	int vm = ( vl + vr ) / 2 ; 
	// nd == -1 --> marcxnidan
	// nd == 1 --> marjvnidan
	if( nd == -1 ){
		int x = -1 ;
		if( node[ v + v + 1 ].mx >= val ){
			x = get_clos( v + v + 1 , vm + 1 , vr , max( l , vm + 1 ) , r , val , nd ) ;
		}
		if( x == -1 ) 
		 x = get_clos( v + v , vl , vm , l , min( r , vm ) , val , nd ) ; 
		return x ; 
	}
	else{
		int x = -1 ;
		if( node[ v + v ].mx >= val ){
			x = get_clos( v + v , vl , vm , l , min( r , vm ) , val , nd ) ; 
		}
		if( x == -1 ) 
		 x = get_clos( v + v + 1 , vm + 1 , vr , max( l , vm + 1 ) , r , val , nd ) ; 
		return x ; 		
	}
}

// now you need a new persistent_seg_tree with decreasing Diff 
// anu ginda jami da yvelaze marcx_yvelaze_marjv

int clos_l[ N ] , clos_r[ N ] ; 
map < int , int > lst ; 

int cc = 2 ;
pair < int , int > sn[ 20 * N ] ;
int jm[ 20 * N ] ;

void build_ot( int v , int vl , int vr ){
	if( vl == vr ){
		jm[ v ] = 0 ; return ;
	}
	int vm = ( vl + vr ) / 2 ;
	sn[ v ].f = cc ; cc ++ ; 
	build_ot( sn[ v ].f , vl , vm ) ;
	sn[ v ].s = cc ; cc ++ ;
	build_ot( sn[ v ].s , vm + 1 , vr ) ;
	jm[ v ] = 0 ; 
	return ;
}
void update_ot( int v , int pp , int vl , int vr , int pos ){
	if( vl == vr ){
		jm[ v ] = 1 ; 
		return ;  
	}
	int vm = ( vl + vr ) / 2 ;
	if( vm >= pos ){
	   sn[ v ].f = cc ; cc ++ ; 
	   sn[ v ].s = sn[ pp ].s ;
	   update_ot( sn[ v ].f , sn[ pp ].f , vl , vm , pos ) ; 
	}
	else{
	   sn[ v ].s = cc ; cc ++ ; 
	   sn[ v ].f = sn[ pp ].f ;
	   update_ot( sn[ v ].s , sn[ pp ].s , vm + 1 , vr , pos ) ; 		
	}
	jm[ v ] = jm[ sn[ v ].f ] + jm[ sn[ v ].s ] ;
}

int sum( int v , int vl , int vr , int l , int r ){
	if( l > r ) return 0 ;
	if( vl == l && vr == r ) return jm[ v ] ;
	int vm = ( vl + vr ) / 2 ;
	int a , b ;
	a = sum( sn[ v ].f , vl , vm , l , min( r , vm ) ) ;
	b = sum( sn[ v ].s , vm + 1 , vr , max( vm + 1 , l ) , r ) ;
	return ( a + b ) ; 
}
int get_ert( int v , int vl , int vr , int l , int r , int tp ){
	if( l > r ) return -1 ; 
	if( jm[ v ] == 0 ) return -1 ;	
	if( vl == vr ) return vl ;
	int vm = ( vl + vr ) / 2 ;
	// -1 --> marcxena
	// 1 --> marjvena
	if( tp == -1 ){
		int x = -1 ;
		if( jm[ sn[ v ].f ] != 0 ){
			x = get_ert( sn[ v ].f , vl , vm , l , min( r , vm ) , tp ) ; 
		}
		if( x == -1 ) x = get_ert( sn[ v ].s , vm + 1 , vr , max( l , vm + 1 ) , r , tp ) ;
		return x ; 
	}
	else{
		int x = -1 ;
		if( jm[ sn[ v ].s ] != 0 ){
			x = get_ert( sn[ v ].s , vm + 1 , vr , max( l , vm + 1 ) , r , tp ) ;
		}
		if( x == -1 ) x = get_ert( sn[ v ].f , vl , vm , l , min( r , vm ) , tp ) ; 
		return x ; 		
	}
}
set < pair < int , int > > se ; 
stack < int > st ; set < int > sis ; 
void init(int N, std::vector<int> H){
    n = N ; FOR( i , N ) a[ i + 1 ] = H[ i ] ;
    // if this works make it into segment tree ?
    xx.mn = 1e9 + 1 ; xx.mx = -1e9 - 1 ; xx.val = 0 ; xx.val1 = 0 ; xx.pos = -1 ;
    build( 1 , 1 , n ) ;
    build_ot( 1 , 1 , n ) ;
	// left to right  
    for( int j = 1 ; j <= n ; j ++ ){
    	while( true ){
    		if( st.size() == 0 ) break ;
    		if( a[ st.top() ] > a[ j ] ){
    			st.pop() ; 
			} else break ; 
		}
		if( st.size() == 0 ){
			clos_l[ j ] = 0 ; 
		} else clos_l[ j ] = st.top() ; 
		st.push( j ) ; 
	}
    // right to left 
    while( st.size() > 0 ) st.pop() ;
    for( int j = n ; j >= 1 ; j -- ){
    	while( true ){
    		if( st.size() == 0 ) break ;
    		if( a[ st.top() ] > a[ j ] ){
    			st.pop() ; 
			} else break ; 
		}
		if( st.size() == 0 ){
			clos_r[ j ] = n + 1 ; 
		} else clos_r[ j ] = st.top() ; 
		st.push( j ) ; 
	}    
	vector < pair < int , int > > v ;
	for( int j = 1 ; j <= n ; j ++ ){
		if( clos_l[ j ] == j - 1 || clos_r[ j ] == j + 1 ) continue ;
		stu bb = get_df( 1 , 1 , n , clos_l[ j ] + 1 , j ) ;
		stu aa = get_df( 1 , 1 , n , j , clos_r[ j ] - 1 ) ;
		bb.mx = min( bb.mx , aa.mx ) ; 
		int af = bb.mx - a[ j ] ;
		v.pb( { af , j } ) ; 
		//cout << af << " " << j << endl ;
	}
	sort( v.begin() , v.end() ) ; 	
    // now slowly create persistent seg tree
    int bef = 1 ;
    for( int j = v.size() - 1 ; j >= 0 ; j -- ){
    	pair < int , int > p ; 
    	p = v[ j ] ; 
    	int cur = cc ; cc ++ ;
    	lst[ p.f ] = cur ; 
    	update_ot( cur , bef , 1 , n , p.s ) ;
    	bef = cur ; 
    	sis.insert( p.f ) ; 
	}
    for( auto x : sis ){
    	se.insert( { x , lst[ x ] } ) ; 
	}   
}

int check( int l , int r , int pos , int tp , int d ){
	// -1 --> marcxnidan
	// 1 --> marjvnidan
	if( tp == -1 ){
		int xix = get_clos( 1 , 1 , n , l , pos , a[ pos ] + 1 , -1 ) ;
		if( xix == -1 ) return 0 ;
		stu ch = get_df( 1 , 1 , n , l , xix ) ; 
		if( ch.val < d ) return 0 ;
		return 1 ; 
	}
	if( tp == 1 ){
		int xix = get_clos( 1 , 1 , n , pos , r , a[ pos ] + 1 , 1 ) ;
		if( xix == -1 ) return 0 ;
		stu ch = get_df( 1 , 1 , n , xix , r ) ; 
		if( ch.val1 < d ) return 0 ;
		return 1 ; 
	}	
}
int max_towers(int L, int R, int D){
   L ++ ; R ++ ; 
   if( se.size() != 0 )
   if( (*(--se.end() )).f < D ) return 1 ; 
   pair < int , int > p ; p.s = 1 ;
   if( se.size() != 0 )
   p = *(se.lower_bound( { D , 0 } ) ) ; 
   int root = p.s ; 
   // now calculate the answerr 
   int ans = sum( root , 1 , n , L , R ) ;
  // if( L == 1 && R == n ) return ans ;
   if( ans == 0 ){
   	 stu cur ; cur = get_df( 1 , 1 , n , L , R ) ;
   	 int pos = cur.pos ; 
   	 if( check( L , R , pos , -1 , D ) == 1 || check( L , R , pos , 1 , D ) == 1 ) return 2 ;
   	 return 1 ;
   }
   // else we have left_right
   int lf = get_ert( root , 1 , n , L , R , -1 ) ;
   int rg = get_ert( root , 1 , n , L , R , 1 ) ;
  // cout << lf << " " << rg << endl ;
   if( lf != -1 )
   ans = ans + check( L , R , lf , -1 , D ) ;
   if( rg != -1 )
   ans = ans + check( L , R , rg , 1 , D ) ;
   return ans ;
   
}


// int main() {
//   int N, Q;
//   assert(2 == scanf("%d %d", &N, &Q));
//   std::vector<int> H(N);
//   for (int i = 0; i < N; ++i) {
//     assert(1 == scanf("%d", &H[i]));
//   }
//   init(N, H);
//
//   for (int i = 0; i < Q; ++i) {
//     int L, R, D;
//     assert(3 == scanf("%d %d %d", &L, &R, &D));
//     printf("%d\n", max_towers(L, R, D));
//   }
//   return 0;
// }

Compilation message

towers.cpp: In function 'int check(int, int, int, int, int)':
towers.cpp:252:1: warning: control reaches end of non-void function [-Wreturn-type]
  252 | }
      | ^
# Verdict Execution time Memory Grader output
1 Correct 385 ms 5584 KB Output is correct
2 Correct 833 ms 10064 KB Output is correct
3 Correct 826 ms 10064 KB Output is correct
4 Correct 813 ms 10192 KB Output is correct
5 Correct 758 ms 10192 KB Output is correct
6 Correct 845 ms 10192 KB Output is correct
7 Correct 814 ms 10192 KB Output is correct
8 Correct 1 ms 384 KB Output is correct
9 Correct 1 ms 464 KB Output is correct
10 Correct 1 ms 464 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 336 KB Output is correct
2 Correct 2 ms 716 KB Output is correct
3 Correct 1 ms 592 KB Output is correct
4 Correct 2 ms 720 KB Output is correct
5 Correct 1 ms 720 KB Output is correct
6 Correct 2 ms 720 KB Output is correct
7 Correct 2 ms 720 KB Output is correct
8 Correct 1 ms 464 KB Output is correct
9 Correct 1 ms 464 KB Output is correct
10 Correct 1 ms 464 KB Output is correct
11 Correct 1 ms 512 KB Output is correct
12 Correct 0 ms 336 KB Output is correct
13 Correct 1 ms 464 KB Output is correct
14 Correct 1 ms 464 KB Output is correct
15 Correct 1 ms 592 KB Output is correct
16 Correct 2 ms 848 KB Output is correct
17 Correct 1 ms 720 KB Output is correct
18 Correct 1 ms 464 KB Output is correct
19 Correct 1 ms 464 KB Output is correct
20 Correct 1 ms 592 KB Output is correct
21 Correct 2 ms 720 KB Output is correct
22 Correct 2 ms 720 KB Output is correct
23 Correct 1 ms 464 KB Output is correct
24 Correct 1 ms 464 KB Output is correct
25 Correct 1 ms 464 KB Output is correct
26 Correct 1 ms 592 KB Output is correct
27 Correct 1 ms 592 KB Output is correct
28 Correct 1 ms 720 KB Output is correct
29 Correct 1 ms 720 KB Output is correct
30 Correct 2 ms 720 KB Output is correct
31 Correct 2 ms 720 KB Output is correct
32 Correct 1 ms 464 KB Output is correct
33 Correct 1 ms 464 KB Output is correct
34 Correct 1 ms 464 KB Output is correct
35 Correct 1 ms 464 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 336 KB Output is correct
2 Correct 2 ms 716 KB Output is correct
3 Correct 1 ms 592 KB Output is correct
4 Correct 2 ms 720 KB Output is correct
5 Correct 1 ms 720 KB Output is correct
6 Correct 2 ms 720 KB Output is correct
7 Correct 2 ms 720 KB Output is correct
8 Correct 1 ms 464 KB Output is correct
9 Correct 1 ms 464 KB Output is correct
10 Correct 1 ms 464 KB Output is correct
11 Correct 1 ms 512 KB Output is correct
12 Correct 0 ms 336 KB Output is correct
13 Correct 1 ms 464 KB Output is correct
14 Correct 1 ms 464 KB Output is correct
15 Correct 1 ms 592 KB Output is correct
16 Correct 2 ms 848 KB Output is correct
17 Correct 1 ms 720 KB Output is correct
18 Correct 1 ms 464 KB Output is correct
19 Correct 1 ms 464 KB Output is correct
20 Correct 1 ms 592 KB Output is correct
21 Correct 2 ms 720 KB Output is correct
22 Correct 2 ms 720 KB Output is correct
23 Correct 1 ms 464 KB Output is correct
24 Correct 1 ms 464 KB Output is correct
25 Correct 1 ms 464 KB Output is correct
26 Correct 1 ms 592 KB Output is correct
27 Correct 1 ms 592 KB Output is correct
28 Correct 1 ms 720 KB Output is correct
29 Correct 1 ms 720 KB Output is correct
30 Correct 2 ms 720 KB Output is correct
31 Correct 2 ms 720 KB Output is correct
32 Correct 1 ms 464 KB Output is correct
33 Correct 1 ms 464 KB Output is correct
34 Correct 1 ms 464 KB Output is correct
35 Correct 1 ms 464 KB Output is correct
36 Correct 37 ms 13268 KB Output is correct
37 Correct 70 ms 21572 KB Output is correct
38 Correct 60 ms 21580 KB Output is correct
39 Correct 79 ms 27480 KB Output is correct
40 Correct 84 ms 27516 KB Output is correct
41 Correct 87 ms 27552 KB Output is correct
42 Correct 101 ms 27492 KB Output is correct
43 Correct 14 ms 10048 KB Output is correct
44 Correct 21 ms 10156 KB Output is correct
45 Correct 15 ms 9936 KB Output is correct
46 Correct 21 ms 9936 KB Output is correct
47 Correct 60 ms 21568 KB Output is correct
48 Correct 85 ms 27592 KB Output is correct
49 Correct 84 ms 27620 KB Output is correct
50 Correct 14 ms 10192 KB Output is correct
51 Correct 15 ms 10184 KB Output is correct
52 Correct 61 ms 21620 KB Output is correct
53 Correct 84 ms 27580 KB Output is correct
54 Correct 84 ms 27592 KB Output is correct
55 Correct 13 ms 10056 KB Output is correct
56 Correct 15 ms 9900 KB Output is correct
57 Correct 62 ms 21052 KB Output is correct
58 Correct 62 ms 21712 KB Output is correct
59 Correct 63 ms 21696 KB Output is correct
60 Correct 78 ms 27552 KB Output is correct
61 Correct 83 ms 27580 KB Output is correct
62 Correct 84 ms 27480 KB Output is correct
63 Correct 90 ms 27520 KB Output is correct
64 Correct 14 ms 10088 KB Output is correct
65 Correct 14 ms 10064 KB Output is correct
66 Correct 13 ms 9936 KB Output is correct
67 Correct 13 ms 10064 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 742 ms 21500 KB Output is correct
2 Correct 1046 ms 21568 KB Output is correct
3 Correct 915 ms 21688 KB Output is correct
4 Correct 1032 ms 27572 KB Output is correct
5 Correct 1081 ms 27584 KB Output is correct
6 Correct 1078 ms 27692 KB Output is correct
7 Correct 981 ms 27584 KB Output is correct
8 Correct 860 ms 10244 KB Output is correct
9 Correct 951 ms 10192 KB Output is correct
10 Correct 993 ms 10064 KB Output is correct
11 Correct 916 ms 10064 KB Output is correct
12 Correct 919 ms 10168 KB Output is correct
13 Correct 1016 ms 10164 KB Output is correct
14 Correct 0 ms 336 KB Output is correct
15 Correct 1 ms 464 KB Output is correct
16 Correct 1 ms 464 KB Output is correct
17 Correct 62 ms 21512 KB Output is correct
18 Correct 87 ms 27552 KB Output is correct
19 Correct 85 ms 27504 KB Output is correct
20 Correct 13 ms 10064 KB Output is correct
21 Correct 17 ms 10048 KB Output is correct
22 Correct 64 ms 21564 KB Output is correct
23 Correct 90 ms 27532 KB Output is correct
24 Correct 83 ms 27544 KB Output is correct
25 Correct 16 ms 10192 KB Output is correct
26 Correct 14 ms 9908 KB Output is correct
27 Correct 1 ms 592 KB Output is correct
28 Correct 1 ms 720 KB Output is correct
29 Correct 2 ms 720 KB Output is correct
30 Correct 1 ms 464 KB Output is correct
31 Correct 1 ms 464 KB Output is correct
32 Correct 1 ms 592 KB Output is correct
33 Correct 1 ms 720 KB Output is correct
34 Correct 1 ms 720 KB Output is correct
35 Correct 1 ms 464 KB Output is correct
36 Correct 1 ms 512 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 219 ms 5216 KB Output is correct
2 Correct 978 ms 21552 KB Output is correct
3 Incorrect 1022 ms 21588 KB 69174th lines differ - on the 1st token, expected: '2', found: '1'
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 336 KB Output is correct
2 Correct 2 ms 716 KB Output is correct
3 Correct 1 ms 592 KB Output is correct
4 Correct 2 ms 720 KB Output is correct
5 Correct 1 ms 720 KB Output is correct
6 Correct 2 ms 720 KB Output is correct
7 Correct 2 ms 720 KB Output is correct
8 Correct 1 ms 464 KB Output is correct
9 Correct 1 ms 464 KB Output is correct
10 Correct 1 ms 464 KB Output is correct
11 Correct 1 ms 512 KB Output is correct
12 Correct 0 ms 336 KB Output is correct
13 Correct 1 ms 464 KB Output is correct
14 Correct 1 ms 464 KB Output is correct
15 Correct 1 ms 592 KB Output is correct
16 Correct 2 ms 848 KB Output is correct
17 Correct 1 ms 720 KB Output is correct
18 Correct 1 ms 464 KB Output is correct
19 Correct 1 ms 464 KB Output is correct
20 Correct 1 ms 592 KB Output is correct
21 Correct 2 ms 720 KB Output is correct
22 Correct 2 ms 720 KB Output is correct
23 Correct 1 ms 464 KB Output is correct
24 Correct 1 ms 464 KB Output is correct
25 Correct 1 ms 464 KB Output is correct
26 Correct 1 ms 592 KB Output is correct
27 Correct 1 ms 592 KB Output is correct
28 Correct 1 ms 720 KB Output is correct
29 Correct 1 ms 720 KB Output is correct
30 Correct 2 ms 720 KB Output is correct
31 Correct 2 ms 720 KB Output is correct
32 Correct 1 ms 464 KB Output is correct
33 Correct 1 ms 464 KB Output is correct
34 Correct 1 ms 464 KB Output is correct
35 Correct 1 ms 464 KB Output is correct
36 Correct 37 ms 13268 KB Output is correct
37 Correct 70 ms 21572 KB Output is correct
38 Correct 60 ms 21580 KB Output is correct
39 Correct 79 ms 27480 KB Output is correct
40 Correct 84 ms 27516 KB Output is correct
41 Correct 87 ms 27552 KB Output is correct
42 Correct 101 ms 27492 KB Output is correct
43 Correct 14 ms 10048 KB Output is correct
44 Correct 21 ms 10156 KB Output is correct
45 Correct 15 ms 9936 KB Output is correct
46 Correct 21 ms 9936 KB Output is correct
47 Correct 60 ms 21568 KB Output is correct
48 Correct 85 ms 27592 KB Output is correct
49 Correct 84 ms 27620 KB Output is correct
50 Correct 14 ms 10192 KB Output is correct
51 Correct 15 ms 10184 KB Output is correct
52 Correct 61 ms 21620 KB Output is correct
53 Correct 84 ms 27580 KB Output is correct
54 Correct 84 ms 27592 KB Output is correct
55 Correct 13 ms 10056 KB Output is correct
56 Correct 15 ms 9900 KB Output is correct
57 Correct 62 ms 21052 KB Output is correct
58 Correct 62 ms 21712 KB Output is correct
59 Correct 63 ms 21696 KB Output is correct
60 Correct 78 ms 27552 KB Output is correct
61 Correct 83 ms 27580 KB Output is correct
62 Correct 84 ms 27480 KB Output is correct
63 Correct 90 ms 27520 KB Output is correct
64 Correct 14 ms 10088 KB Output is correct
65 Correct 14 ms 10064 KB Output is correct
66 Correct 13 ms 9936 KB Output is correct
67 Correct 13 ms 10064 KB Output is correct
68 Correct 742 ms 21500 KB Output is correct
69 Correct 1046 ms 21568 KB Output is correct
70 Correct 915 ms 21688 KB Output is correct
71 Correct 1032 ms 27572 KB Output is correct
72 Correct 1081 ms 27584 KB Output is correct
73 Correct 1078 ms 27692 KB Output is correct
74 Correct 981 ms 27584 KB Output is correct
75 Correct 860 ms 10244 KB Output is correct
76 Correct 951 ms 10192 KB Output is correct
77 Correct 993 ms 10064 KB Output is correct
78 Correct 916 ms 10064 KB Output is correct
79 Correct 919 ms 10168 KB Output is correct
80 Correct 1016 ms 10164 KB Output is correct
81 Correct 0 ms 336 KB Output is correct
82 Correct 1 ms 464 KB Output is correct
83 Correct 1 ms 464 KB Output is correct
84 Correct 62 ms 21512 KB Output is correct
85 Correct 87 ms 27552 KB Output is correct
86 Correct 85 ms 27504 KB Output is correct
87 Correct 13 ms 10064 KB Output is correct
88 Correct 17 ms 10048 KB Output is correct
89 Correct 64 ms 21564 KB Output is correct
90 Correct 90 ms 27532 KB Output is correct
91 Correct 83 ms 27544 KB Output is correct
92 Correct 16 ms 10192 KB Output is correct
93 Correct 14 ms 9908 KB Output is correct
94 Correct 1 ms 592 KB Output is correct
95 Correct 1 ms 720 KB Output is correct
96 Correct 2 ms 720 KB Output is correct
97 Correct 1 ms 464 KB Output is correct
98 Correct 1 ms 464 KB Output is correct
99 Correct 1 ms 592 KB Output is correct
100 Correct 1 ms 720 KB Output is correct
101 Correct 1 ms 720 KB Output is correct
102 Correct 1 ms 464 KB Output is correct
103 Correct 1 ms 512 KB Output is correct
104 Correct 985 ms 19704 KB Output is correct
105 Correct 954 ms 21540 KB Output is correct
106 Correct 1000 ms 21696 KB Output is correct
107 Correct 998 ms 27580 KB Output is correct
108 Correct 1020 ms 27584 KB Output is correct
109 Correct 917 ms 27584 KB Output is correct
110 Correct 1031 ms 27540 KB Output is correct
111 Correct 922 ms 10192 KB Output is correct
112 Correct 780 ms 10192 KB Output is correct
113 Correct 843 ms 9936 KB Output is correct
114 Correct 1010 ms 10056 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 385 ms 5584 KB Output is correct
2 Correct 833 ms 10064 KB Output is correct
3 Correct 826 ms 10064 KB Output is correct
4 Correct 813 ms 10192 KB Output is correct
5 Correct 758 ms 10192 KB Output is correct
6 Correct 845 ms 10192 KB Output is correct
7 Correct 814 ms 10192 KB Output is correct
8 Correct 1 ms 384 KB Output is correct
9 Correct 1 ms 464 KB Output is correct
10 Correct 1 ms 464 KB Output is correct
11 Correct 1 ms 336 KB Output is correct
12 Correct 2 ms 716 KB Output is correct
13 Correct 1 ms 592 KB Output is correct
14 Correct 2 ms 720 KB Output is correct
15 Correct 1 ms 720 KB Output is correct
16 Correct 2 ms 720 KB Output is correct
17 Correct 2 ms 720 KB Output is correct
18 Correct 1 ms 464 KB Output is correct
19 Correct 1 ms 464 KB Output is correct
20 Correct 1 ms 464 KB Output is correct
21 Correct 1 ms 512 KB Output is correct
22 Correct 0 ms 336 KB Output is correct
23 Correct 1 ms 464 KB Output is correct
24 Correct 1 ms 464 KB Output is correct
25 Correct 1 ms 592 KB Output is correct
26 Correct 2 ms 848 KB Output is correct
27 Correct 1 ms 720 KB Output is correct
28 Correct 1 ms 464 KB Output is correct
29 Correct 1 ms 464 KB Output is correct
30 Correct 1 ms 592 KB Output is correct
31 Correct 2 ms 720 KB Output is correct
32 Correct 2 ms 720 KB Output is correct
33 Correct 1 ms 464 KB Output is correct
34 Correct 1 ms 464 KB Output is correct
35 Correct 1 ms 464 KB Output is correct
36 Correct 1 ms 592 KB Output is correct
37 Correct 1 ms 592 KB Output is correct
38 Correct 1 ms 720 KB Output is correct
39 Correct 1 ms 720 KB Output is correct
40 Correct 2 ms 720 KB Output is correct
41 Correct 2 ms 720 KB Output is correct
42 Correct 1 ms 464 KB Output is correct
43 Correct 1 ms 464 KB Output is correct
44 Correct 1 ms 464 KB Output is correct
45 Correct 1 ms 464 KB Output is correct
46 Correct 37 ms 13268 KB Output is correct
47 Correct 70 ms 21572 KB Output is correct
48 Correct 60 ms 21580 KB Output is correct
49 Correct 79 ms 27480 KB Output is correct
50 Correct 84 ms 27516 KB Output is correct
51 Correct 87 ms 27552 KB Output is correct
52 Correct 101 ms 27492 KB Output is correct
53 Correct 14 ms 10048 KB Output is correct
54 Correct 21 ms 10156 KB Output is correct
55 Correct 15 ms 9936 KB Output is correct
56 Correct 21 ms 9936 KB Output is correct
57 Correct 60 ms 21568 KB Output is correct
58 Correct 85 ms 27592 KB Output is correct
59 Correct 84 ms 27620 KB Output is correct
60 Correct 14 ms 10192 KB Output is correct
61 Correct 15 ms 10184 KB Output is correct
62 Correct 61 ms 21620 KB Output is correct
63 Correct 84 ms 27580 KB Output is correct
64 Correct 84 ms 27592 KB Output is correct
65 Correct 13 ms 10056 KB Output is correct
66 Correct 15 ms 9900 KB Output is correct
67 Correct 62 ms 21052 KB Output is correct
68 Correct 62 ms 21712 KB Output is correct
69 Correct 63 ms 21696 KB Output is correct
70 Correct 78 ms 27552 KB Output is correct
71 Correct 83 ms 27580 KB Output is correct
72 Correct 84 ms 27480 KB Output is correct
73 Correct 90 ms 27520 KB Output is correct
74 Correct 14 ms 10088 KB Output is correct
75 Correct 14 ms 10064 KB Output is correct
76 Correct 13 ms 9936 KB Output is correct
77 Correct 13 ms 10064 KB Output is correct
78 Correct 742 ms 21500 KB Output is correct
79 Correct 1046 ms 21568 KB Output is correct
80 Correct 915 ms 21688 KB Output is correct
81 Correct 1032 ms 27572 KB Output is correct
82 Correct 1081 ms 27584 KB Output is correct
83 Correct 1078 ms 27692 KB Output is correct
84 Correct 981 ms 27584 KB Output is correct
85 Correct 860 ms 10244 KB Output is correct
86 Correct 951 ms 10192 KB Output is correct
87 Correct 993 ms 10064 KB Output is correct
88 Correct 916 ms 10064 KB Output is correct
89 Correct 919 ms 10168 KB Output is correct
90 Correct 1016 ms 10164 KB Output is correct
91 Correct 0 ms 336 KB Output is correct
92 Correct 1 ms 464 KB Output is correct
93 Correct 1 ms 464 KB Output is correct
94 Correct 62 ms 21512 KB Output is correct
95 Correct 87 ms 27552 KB Output is correct
96 Correct 85 ms 27504 KB Output is correct
97 Correct 13 ms 10064 KB Output is correct
98 Correct 17 ms 10048 KB Output is correct
99 Correct 64 ms 21564 KB Output is correct
100 Correct 90 ms 27532 KB Output is correct
101 Correct 83 ms 27544 KB Output is correct
102 Correct 16 ms 10192 KB Output is correct
103 Correct 14 ms 9908 KB Output is correct
104 Correct 1 ms 592 KB Output is correct
105 Correct 1 ms 720 KB Output is correct
106 Correct 2 ms 720 KB Output is correct
107 Correct 1 ms 464 KB Output is correct
108 Correct 1 ms 464 KB Output is correct
109 Correct 1 ms 592 KB Output is correct
110 Correct 1 ms 720 KB Output is correct
111 Correct 1 ms 720 KB Output is correct
112 Correct 1 ms 464 KB Output is correct
113 Correct 1 ms 512 KB Output is correct
114 Correct 219 ms 5216 KB Output is correct
115 Correct 978 ms 21552 KB Output is correct
116 Incorrect 1022 ms 21588 KB 69174th lines differ - on the 1st token, expected: '2', found: '1'
117 Halted 0 ms 0 KB -