#include<bits/stdc++.h>
using namespace std ;
typedef long long ll ;
const int MAXN = 120007 , LOG = 20 ;
int n , m ;
vector < int > v[ MAXN ] ;
pair < int , int > a[ MAXN ] ;
int sz[ MAXN ] , heavy[ MAXN ] , LCA[ MAXN ][ LOG ] , lvl[ MAXN ] ;
int root[ MAXN ] , pos_in_tree[ MAXN ] ;
int id_fst[ MAXN ] , id_lst[ MAXN ] ;
void dfs ( int vertex , int lst ) {
sz[ vertex ] = 1 ;
for ( int i = 1 ; i < LOG ; ++ i ) {
LCA[ vertex ][ i ] = LCA[ LCA[ vertex ][ i - 1 ] ][ i - 1 ] ;
}
int mx = -1 , id = 0 ;
for ( auto x : v[ vertex ] ) {
if ( x == lst ) { continue ; }
LCA[ x ][ 0 ] = vertex ;
lvl[ x ] = lvl[ vertex ] + 1 ;
dfs ( x , vertex ) ;
sz[ vertex ] += sz[ x ] ;
if ( mx < sz[ x ] ) {
mx = sz[ x ] ;
id = x ;
}
}
heavy[ vertex ] = id ;
}
int get_LCA ( int x , int y ) {
for ( int i = LOG - 1 ; i >= 0 ; -- i ) {
if ( lvl[ x ] - ( 1 << i ) >= lvl[ y ] ) {
x = LCA[ x ][ i ] ;
}
if ( lvl[ y ] - ( 1 << i ) >= lvl[ x ] ) {
y = LCA[ y ][ i ] ;
}
}
for ( int i = LOG - 1 ; i >= 0 ; -- i ) {
if ( LCA[ x ][ i ] != LCA[ y ][ i ] ) {
x = LCA[ x ][ i ] ;
y = LCA[ y ][ i ] ;
}
}
if ( x != y ) { x = LCA[ x ][ 0 ] ; }
return x ;
}
int move_up ( int x , int cnt ) {
for ( int i = LOG - 1 ; i >= 0 ; -- i ) {
if ( cnt >= ( 1 << i ) ) {
x = LCA[ x ][ i ] ;
cnt -= ( 1 << i ) ;
}
}
return x ;
}
vector < int > adj[ 10 * MAXN ] ;
int in_vert[ 4 * MAXN ] , out_vert[ 4 * MAXN ] ;
vector < int > tr[ 4 * MAXN ] ;
class Tree {
public :
int tp = 0 ;
void init ( int where , int IL , int IR ) {
in_vert[ where ] = ++ tp ;
out_vert[ where ] = ++ tp ;
tr[ where ].clear ( ) ;
if ( IL == IR ) { return ; }
int mid = ( IL + IR ) / 2 ;
init ( 2 * where , IL , mid ) ;
init ( 2 * where + 1 , mid + 1 , IR ) ;
}
void add ( int where , int IL , int IR , int CURL , int CURR , int nw ) {
if ( IL > IR || CURL > CURR ) { return ; }
if ( IR < CURL || CURR < IL ) { return ; }
if ( CURL <= IL && IR <= CURR ) {
tr[ where ].push_back ( nw ) ;
adj[ in_vert[ where ] ].push_back ( nw ) ;
adj[ nw ].push_back ( out_vert[ where ] ) ;
return ;
}
int mid = ( IL + IR ) / 2 ;
add ( 2 * where , IL , mid , CURL , CURR , nw ) ;
add ( 2 * where + 1 , mid + 1 , IR , CURL , CURR , nw ) ;
}
void connect ( int where , int IL , int IR , int pos , int val , bool fl ) {
if ( fl == false ) {
adj[ out_vert[ where ] ].push_back ( val ) ;
}
else {
adj[ val ].push_back ( in_vert[ where ] ) ;
}
if ( IL == IR ) { return ; }
int mid = ( IL + IR ) / 2 ;
if ( pos <= mid ) {
connect ( 2 * where , IL , mid , pos , val , fl ) ;
}
else {
connect ( 2 * where + 1 , mid + 1 , IR , pos , val , fl ) ;
}
}
};
Tree w ;
int used[ 6 * MAXN ] ;
void input ( ) {
cin >> n ;
for ( int i = 1 ; i <= n ; ++ i ) {
v[ i ].clear ( ) ;
id_fst[ i ] = id_lst[ i ] = 0 ;
}
for ( int x , y , i = 1 ; i < n ; ++ i ) {
cin >> x >> y ;
v[ x ].push_back ( y ) ;
v[ y ].push_back ( x ) ;
}
cin >> m ;
for ( int i = 1 ; i <= m ; ++ i ) {
cin >> a[ i ].first >> a[ i ].second ;
id_fst[ a[ i ].first ] = i ;
id_lst[ a[ i ].second ] = i ;
}
for ( int i = 1 ; i <= w.tp ; ++ i ) {
used[ i ] = 0 ;
adj[ i ].clear ( ) ;
}
}
bool dfs ( int vertex ) {
used[ vertex ] = 1 ;
for ( auto x : adj[ vertex ] ) {
if ( used[ x ] == 1 ) { return true ; }
if ( used[ x ] == 0 ) {
if ( dfs ( x ) == true ) { return true ; }
}
}
used[ vertex ] = 2 ;
return false ;
}
void solve ( ) {
dfs ( 1 , -1 ) ;
int tp = 0 ;
for ( int i = 1 ; i <= n ; ++ i ) {
if ( heavy[ LCA[ i ][ 0 ] ] != i ) {
int x = i ;
while ( x > 0 ) {
root[ x ] = i ;
pos_in_tree[ x ] = ++ tp ;
x = heavy[ x ] ;
}
}
}
w.tp = m ;
w.init ( 1 , 1 , n ) ;
for ( int i = 1 ; i <= m ; ++ i ) {
int x = a[ i ].first , y = a[ i ].second ;
int aux = get_LCA ( x , y ) ;
if ( aux != x && aux != y ) {
x = LCA[ x ][ 0 ] , y = LCA[ y ][ 0 ] ;
}
else {
if ( lvl[ x ] > lvl[ y ] ) { swap ( x , y ) ; }
x = move_up ( y , lvl[ y ] - lvl[ x ] - 1 ) ;
y = LCA[ y ][ 0 ] ;
if ( lvl[ x ] > lvl[ y ] ) { continue ; }
}
while ( root[ x ] != root[ y ] ) {
if ( lvl[ root[ x ] ] < lvl[ root[ y ] ] ) { swap ( x , y ) ; }
w.add ( 1 , 1 , n , pos_in_tree[ root[ x ] ] , pos_in_tree[ x ] , i ) ;
x = LCA[ root[ x ] ][ 0 ] ;
}
if ( pos_in_tree[ x ] > pos_in_tree[ y ] ) { swap ( x , y ) ; }
w.add ( 1 , 1 , n , pos_in_tree[ x ] , pos_in_tree[ y ] , i ) ;
}
for ( int i = 1 ; i <= m ; ++ i ) {
w.connect ( 1 , 1 , n , pos_in_tree[ a[ i ].first ] , i , true ) ;
w.connect ( 1 , 1 , n , pos_in_tree[ a[ i ].second ] , i , false ) ;
}
for ( int i = 1 ; i <= n ; ++ i ) {
if ( id_fst[ i ] > 0 && id_lst[ i ] > 0 ) {
adj[ id_fst[ i ] ].push_back ( id_lst[ i ] ) ;
}
}
for ( int i = 1 ; i <= w.tp ; ++ i ) {
if ( used[ i ] == 0 ) {
if ( dfs ( i ) == true ) {
cout << "No\n" ;
return ;
}
}
}
cout << "Yes\n" ;
}
int main ( ) {
ios_base :: sync_with_stdio ( false ) ;
cin.tie ( NULL ) ;
int t ;
/// t = 1 ;
/// scanf ( "%d" , &t ) ;
cin >> t ;
while ( t -- ) {
input ( ) ;
solve ( ) ;
}
return 0 ;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
19 ms |
42624 KB |
Output is correct |
2 |
Correct |
20 ms |
42644 KB |
Output is correct |
3 |
Correct |
20 ms |
42668 KB |
Output is correct |
4 |
Correct |
33 ms |
42708 KB |
Output is correct |
5 |
Correct |
47 ms |
43468 KB |
Output is correct |
6 |
Correct |
21 ms |
42708 KB |
Output is correct |
7 |
Correct |
21 ms |
42708 KB |
Output is correct |
8 |
Correct |
22 ms |
42836 KB |
Output is correct |
9 |
Correct |
71 ms |
46728 KB |
Output is correct |
10 |
Correct |
77 ms |
76032 KB |
Output is correct |
11 |
Correct |
28 ms |
42708 KB |
Output is correct |
12 |
Correct |
70 ms |
43732 KB |
Output is correct |
13 |
Correct |
220 ms |
102940 KB |
Output is correct |
14 |
Correct |
208 ms |
101184 KB |
Output is correct |
15 |
Correct |
407 ms |
107832 KB |
Output is correct |
16 |
Correct |
853 ms |
146352 KB |
Output is correct |
17 |
Correct |
256 ms |
113728 KB |
Output is correct |
18 |
Correct |
206 ms |
109880 KB |
Output is correct |
19 |
Correct |
241 ms |
109604 KB |
Output is correct |
20 |
Correct |
232 ms |
108380 KB |
Output is correct |
21 |
Correct |
256 ms |
112136 KB |
Output is correct |
22 |
Correct |
138 ms |
92324 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
22 ms |
42580 KB |
Output is correct |
2 |
Correct |
21 ms |
42580 KB |
Output is correct |
3 |
Correct |
22 ms |
42708 KB |
Output is correct |
4 |
Correct |
23 ms |
42632 KB |
Output is correct |
5 |
Correct |
25 ms |
42716 KB |
Output is correct |
6 |
Correct |
25 ms |
42696 KB |
Output is correct |
7 |
Correct |
23 ms |
42700 KB |
Output is correct |
8 |
Correct |
22 ms |
42740 KB |
Output is correct |
9 |
Correct |
22 ms |
42708 KB |
Output is correct |
10 |
Correct |
23 ms |
42700 KB |
Output is correct |
11 |
Correct |
22 ms |
42688 KB |
Output is correct |
12 |
Correct |
20 ms |
42708 KB |
Output is correct |
13 |
Correct |
22 ms |
42708 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
22 ms |
42580 KB |
Output is correct |
2 |
Correct |
21 ms |
42580 KB |
Output is correct |
3 |
Correct |
22 ms |
42708 KB |
Output is correct |
4 |
Correct |
23 ms |
42632 KB |
Output is correct |
5 |
Correct |
25 ms |
42716 KB |
Output is correct |
6 |
Correct |
25 ms |
42696 KB |
Output is correct |
7 |
Correct |
23 ms |
42700 KB |
Output is correct |
8 |
Correct |
22 ms |
42740 KB |
Output is correct |
9 |
Correct |
22 ms |
42708 KB |
Output is correct |
10 |
Correct |
23 ms |
42700 KB |
Output is correct |
11 |
Correct |
22 ms |
42688 KB |
Output is correct |
12 |
Correct |
20 ms |
42708 KB |
Output is correct |
13 |
Correct |
22 ms |
42708 KB |
Output is correct |
14 |
Correct |
20 ms |
42576 KB |
Output is correct |
15 |
Correct |
20 ms |
42580 KB |
Output is correct |
16 |
Correct |
22 ms |
42756 KB |
Output is correct |
17 |
Correct |
22 ms |
42660 KB |
Output is correct |
18 |
Correct |
23 ms |
42664 KB |
Output is correct |
19 |
Correct |
20 ms |
42588 KB |
Output is correct |
20 |
Correct |
23 ms |
42668 KB |
Output is correct |
21 |
Correct |
23 ms |
42700 KB |
Output is correct |
22 |
Correct |
23 ms |
42692 KB |
Output is correct |
23 |
Correct |
21 ms |
42588 KB |
Output is correct |
24 |
Correct |
23 ms |
42620 KB |
Output is correct |
25 |
Correct |
23 ms |
42724 KB |
Output is correct |
26 |
Correct |
21 ms |
42708 KB |
Output is correct |
27 |
Correct |
23 ms |
42748 KB |
Output is correct |
28 |
Correct |
21 ms |
42560 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
22 ms |
42580 KB |
Output is correct |
2 |
Correct |
21 ms |
42580 KB |
Output is correct |
3 |
Correct |
22 ms |
42708 KB |
Output is correct |
4 |
Correct |
23 ms |
42632 KB |
Output is correct |
5 |
Correct |
25 ms |
42716 KB |
Output is correct |
6 |
Correct |
25 ms |
42696 KB |
Output is correct |
7 |
Correct |
23 ms |
42700 KB |
Output is correct |
8 |
Correct |
22 ms |
42740 KB |
Output is correct |
9 |
Correct |
22 ms |
42708 KB |
Output is correct |
10 |
Correct |
23 ms |
42700 KB |
Output is correct |
11 |
Correct |
22 ms |
42688 KB |
Output is correct |
12 |
Correct |
20 ms |
42708 KB |
Output is correct |
13 |
Correct |
22 ms |
42708 KB |
Output is correct |
14 |
Correct |
20 ms |
42576 KB |
Output is correct |
15 |
Correct |
20 ms |
42580 KB |
Output is correct |
16 |
Correct |
22 ms |
42756 KB |
Output is correct |
17 |
Correct |
22 ms |
42660 KB |
Output is correct |
18 |
Correct |
23 ms |
42664 KB |
Output is correct |
19 |
Correct |
20 ms |
42588 KB |
Output is correct |
20 |
Correct |
23 ms |
42668 KB |
Output is correct |
21 |
Correct |
23 ms |
42700 KB |
Output is correct |
22 |
Correct |
23 ms |
42692 KB |
Output is correct |
23 |
Correct |
21 ms |
42588 KB |
Output is correct |
24 |
Correct |
23 ms |
42620 KB |
Output is correct |
25 |
Correct |
23 ms |
42724 KB |
Output is correct |
26 |
Correct |
21 ms |
42708 KB |
Output is correct |
27 |
Correct |
23 ms |
42748 KB |
Output is correct |
28 |
Correct |
21 ms |
42560 KB |
Output is correct |
29 |
Correct |
24 ms |
42836 KB |
Output is correct |
30 |
Correct |
23 ms |
42812 KB |
Output is correct |
31 |
Correct |
24 ms |
42836 KB |
Output is correct |
32 |
Correct |
23 ms |
42708 KB |
Output is correct |
33 |
Correct |
22 ms |
42708 KB |
Output is correct |
34 |
Correct |
24 ms |
42708 KB |
Output is correct |
35 |
Correct |
24 ms |
42764 KB |
Output is correct |
36 |
Correct |
23 ms |
42708 KB |
Output is correct |
37 |
Correct |
23 ms |
42836 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
22 ms |
42580 KB |
Output is correct |
2 |
Correct |
21 ms |
42580 KB |
Output is correct |
3 |
Correct |
22 ms |
42708 KB |
Output is correct |
4 |
Correct |
23 ms |
42632 KB |
Output is correct |
5 |
Correct |
25 ms |
42716 KB |
Output is correct |
6 |
Correct |
25 ms |
42696 KB |
Output is correct |
7 |
Correct |
23 ms |
42700 KB |
Output is correct |
8 |
Correct |
22 ms |
42740 KB |
Output is correct |
9 |
Correct |
22 ms |
42708 KB |
Output is correct |
10 |
Correct |
23 ms |
42700 KB |
Output is correct |
11 |
Correct |
22 ms |
42688 KB |
Output is correct |
12 |
Correct |
20 ms |
42708 KB |
Output is correct |
13 |
Correct |
22 ms |
42708 KB |
Output is correct |
14 |
Correct |
20 ms |
42576 KB |
Output is correct |
15 |
Correct |
20 ms |
42580 KB |
Output is correct |
16 |
Correct |
22 ms |
42756 KB |
Output is correct |
17 |
Correct |
22 ms |
42660 KB |
Output is correct |
18 |
Correct |
23 ms |
42664 KB |
Output is correct |
19 |
Correct |
20 ms |
42588 KB |
Output is correct |
20 |
Correct |
23 ms |
42668 KB |
Output is correct |
21 |
Correct |
23 ms |
42700 KB |
Output is correct |
22 |
Correct |
23 ms |
42692 KB |
Output is correct |
23 |
Correct |
21 ms |
42588 KB |
Output is correct |
24 |
Correct |
23 ms |
42620 KB |
Output is correct |
25 |
Correct |
23 ms |
42724 KB |
Output is correct |
26 |
Correct |
21 ms |
42708 KB |
Output is correct |
27 |
Correct |
23 ms |
42748 KB |
Output is correct |
28 |
Correct |
21 ms |
42560 KB |
Output is correct |
29 |
Correct |
24 ms |
42836 KB |
Output is correct |
30 |
Correct |
23 ms |
42812 KB |
Output is correct |
31 |
Correct |
24 ms |
42836 KB |
Output is correct |
32 |
Correct |
23 ms |
42708 KB |
Output is correct |
33 |
Correct |
22 ms |
42708 KB |
Output is correct |
34 |
Correct |
24 ms |
42708 KB |
Output is correct |
35 |
Correct |
24 ms |
42764 KB |
Output is correct |
36 |
Correct |
23 ms |
42708 KB |
Output is correct |
37 |
Correct |
23 ms |
42836 KB |
Output is correct |
38 |
Correct |
66 ms |
46412 KB |
Output is correct |
39 |
Correct |
76 ms |
75896 KB |
Output is correct |
40 |
Correct |
72 ms |
46220 KB |
Output is correct |
41 |
Correct |
76 ms |
45800 KB |
Output is correct |
42 |
Correct |
63 ms |
46204 KB |
Output is correct |
43 |
Correct |
53 ms |
45148 KB |
Output is correct |
44 |
Correct |
37 ms |
43472 KB |
Output is correct |
45 |
Correct |
99 ms |
64204 KB |
Output is correct |
46 |
Correct |
99 ms |
65088 KB |
Output is correct |
47 |
Correct |
83 ms |
70520 KB |
Output is correct |
48 |
Correct |
81 ms |
70604 KB |
Output is correct |
49 |
Correct |
83 ms |
63616 KB |
Output is correct |
50 |
Correct |
86 ms |
65288 KB |
Output is correct |
51 |
Correct |
76 ms |
66124 KB |
Output is correct |
52 |
Correct |
74 ms |
64860 KB |
Output is correct |
53 |
Correct |
39 ms |
44760 KB |
Output is correct |
54 |
Correct |
110 ms |
64984 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
20 ms |
42568 KB |
Output is correct |
2 |
Correct |
21 ms |
42656 KB |
Output is correct |
3 |
Correct |
20 ms |
42560 KB |
Output is correct |
4 |
Correct |
21 ms |
42596 KB |
Output is correct |
5 |
Correct |
29 ms |
42576 KB |
Output is correct |
6 |
Correct |
22 ms |
42708 KB |
Output is correct |
7 |
Correct |
22 ms |
42628 KB |
Output is correct |
8 |
Correct |
21 ms |
42580 KB |
Output is correct |
9 |
Correct |
22 ms |
42708 KB |
Output is correct |
10 |
Correct |
25 ms |
42716 KB |
Output is correct |
11 |
Correct |
21 ms |
42656 KB |
Output is correct |
12 |
Correct |
24 ms |
42740 KB |
Output is correct |
13 |
Correct |
51 ms |
43212 KB |
Output is correct |
14 |
Correct |
71 ms |
43468 KB |
Output is correct |
15 |
Correct |
60 ms |
43336 KB |
Output is correct |
16 |
Correct |
154 ms |
68812 KB |
Output is correct |
17 |
Correct |
407 ms |
91216 KB |
Output is correct |
18 |
Correct |
753 ms |
115812 KB |
Output is correct |
19 |
Correct |
223 ms |
75780 KB |
Output is correct |
20 |
Correct |
237 ms |
74460 KB |
Output is correct |
21 |
Correct |
227 ms |
76108 KB |
Output is correct |
22 |
Correct |
404 ms |
89476 KB |
Output is correct |
23 |
Correct |
313 ms |
89016 KB |
Output is correct |
24 |
Correct |
338 ms |
90052 KB |
Output is correct |
25 |
Correct |
331 ms |
90824 KB |
Output is correct |
26 |
Correct |
350 ms |
91236 KB |
Output is correct |
27 |
Correct |
384 ms |
100296 KB |
Output is correct |
28 |
Correct |
362 ms |
105648 KB |
Output is correct |
29 |
Correct |
370 ms |
102732 KB |
Output is correct |
30 |
Correct |
336 ms |
92108 KB |
Output is correct |
31 |
Correct |
332 ms |
93380 KB |
Output is correct |
32 |
Correct |
324 ms |
90440 KB |
Output is correct |
33 |
Correct |
310 ms |
93304 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
19 ms |
42624 KB |
Output is correct |
2 |
Correct |
20 ms |
42644 KB |
Output is correct |
3 |
Correct |
20 ms |
42668 KB |
Output is correct |
4 |
Correct |
33 ms |
42708 KB |
Output is correct |
5 |
Correct |
47 ms |
43468 KB |
Output is correct |
6 |
Correct |
21 ms |
42708 KB |
Output is correct |
7 |
Correct |
21 ms |
42708 KB |
Output is correct |
8 |
Correct |
22 ms |
42836 KB |
Output is correct |
9 |
Correct |
71 ms |
46728 KB |
Output is correct |
10 |
Correct |
77 ms |
76032 KB |
Output is correct |
11 |
Correct |
28 ms |
42708 KB |
Output is correct |
12 |
Correct |
70 ms |
43732 KB |
Output is correct |
13 |
Correct |
220 ms |
102940 KB |
Output is correct |
14 |
Correct |
208 ms |
101184 KB |
Output is correct |
15 |
Correct |
407 ms |
107832 KB |
Output is correct |
16 |
Correct |
853 ms |
146352 KB |
Output is correct |
17 |
Correct |
256 ms |
113728 KB |
Output is correct |
18 |
Correct |
206 ms |
109880 KB |
Output is correct |
19 |
Correct |
241 ms |
109604 KB |
Output is correct |
20 |
Correct |
232 ms |
108380 KB |
Output is correct |
21 |
Correct |
256 ms |
112136 KB |
Output is correct |
22 |
Correct |
138 ms |
92324 KB |
Output is correct |
23 |
Correct |
22 ms |
42580 KB |
Output is correct |
24 |
Correct |
21 ms |
42580 KB |
Output is correct |
25 |
Correct |
22 ms |
42708 KB |
Output is correct |
26 |
Correct |
23 ms |
42632 KB |
Output is correct |
27 |
Correct |
25 ms |
42716 KB |
Output is correct |
28 |
Correct |
25 ms |
42696 KB |
Output is correct |
29 |
Correct |
23 ms |
42700 KB |
Output is correct |
30 |
Correct |
22 ms |
42740 KB |
Output is correct |
31 |
Correct |
22 ms |
42708 KB |
Output is correct |
32 |
Correct |
23 ms |
42700 KB |
Output is correct |
33 |
Correct |
22 ms |
42688 KB |
Output is correct |
34 |
Correct |
20 ms |
42708 KB |
Output is correct |
35 |
Correct |
22 ms |
42708 KB |
Output is correct |
36 |
Correct |
20 ms |
42576 KB |
Output is correct |
37 |
Correct |
20 ms |
42580 KB |
Output is correct |
38 |
Correct |
22 ms |
42756 KB |
Output is correct |
39 |
Correct |
22 ms |
42660 KB |
Output is correct |
40 |
Correct |
23 ms |
42664 KB |
Output is correct |
41 |
Correct |
20 ms |
42588 KB |
Output is correct |
42 |
Correct |
23 ms |
42668 KB |
Output is correct |
43 |
Correct |
23 ms |
42700 KB |
Output is correct |
44 |
Correct |
23 ms |
42692 KB |
Output is correct |
45 |
Correct |
21 ms |
42588 KB |
Output is correct |
46 |
Correct |
23 ms |
42620 KB |
Output is correct |
47 |
Correct |
23 ms |
42724 KB |
Output is correct |
48 |
Correct |
21 ms |
42708 KB |
Output is correct |
49 |
Correct |
23 ms |
42748 KB |
Output is correct |
50 |
Correct |
21 ms |
42560 KB |
Output is correct |
51 |
Correct |
24 ms |
42836 KB |
Output is correct |
52 |
Correct |
23 ms |
42812 KB |
Output is correct |
53 |
Correct |
24 ms |
42836 KB |
Output is correct |
54 |
Correct |
23 ms |
42708 KB |
Output is correct |
55 |
Correct |
22 ms |
42708 KB |
Output is correct |
56 |
Correct |
24 ms |
42708 KB |
Output is correct |
57 |
Correct |
24 ms |
42764 KB |
Output is correct |
58 |
Correct |
23 ms |
42708 KB |
Output is correct |
59 |
Correct |
23 ms |
42836 KB |
Output is correct |
60 |
Correct |
66 ms |
46412 KB |
Output is correct |
61 |
Correct |
76 ms |
75896 KB |
Output is correct |
62 |
Correct |
72 ms |
46220 KB |
Output is correct |
63 |
Correct |
76 ms |
45800 KB |
Output is correct |
64 |
Correct |
63 ms |
46204 KB |
Output is correct |
65 |
Correct |
53 ms |
45148 KB |
Output is correct |
66 |
Correct |
37 ms |
43472 KB |
Output is correct |
67 |
Correct |
99 ms |
64204 KB |
Output is correct |
68 |
Correct |
99 ms |
65088 KB |
Output is correct |
69 |
Correct |
83 ms |
70520 KB |
Output is correct |
70 |
Correct |
81 ms |
70604 KB |
Output is correct |
71 |
Correct |
83 ms |
63616 KB |
Output is correct |
72 |
Correct |
86 ms |
65288 KB |
Output is correct |
73 |
Correct |
76 ms |
66124 KB |
Output is correct |
74 |
Correct |
74 ms |
64860 KB |
Output is correct |
75 |
Correct |
39 ms |
44760 KB |
Output is correct |
76 |
Correct |
110 ms |
64984 KB |
Output is correct |
77 |
Correct |
20 ms |
42568 KB |
Output is correct |
78 |
Correct |
21 ms |
42656 KB |
Output is correct |
79 |
Correct |
20 ms |
42560 KB |
Output is correct |
80 |
Correct |
21 ms |
42596 KB |
Output is correct |
81 |
Correct |
29 ms |
42576 KB |
Output is correct |
82 |
Correct |
22 ms |
42708 KB |
Output is correct |
83 |
Correct |
22 ms |
42628 KB |
Output is correct |
84 |
Correct |
21 ms |
42580 KB |
Output is correct |
85 |
Correct |
22 ms |
42708 KB |
Output is correct |
86 |
Correct |
25 ms |
42716 KB |
Output is correct |
87 |
Correct |
21 ms |
42656 KB |
Output is correct |
88 |
Correct |
24 ms |
42740 KB |
Output is correct |
89 |
Correct |
51 ms |
43212 KB |
Output is correct |
90 |
Correct |
71 ms |
43468 KB |
Output is correct |
91 |
Correct |
60 ms |
43336 KB |
Output is correct |
92 |
Correct |
154 ms |
68812 KB |
Output is correct |
93 |
Correct |
407 ms |
91216 KB |
Output is correct |
94 |
Correct |
753 ms |
115812 KB |
Output is correct |
95 |
Correct |
223 ms |
75780 KB |
Output is correct |
96 |
Correct |
237 ms |
74460 KB |
Output is correct |
97 |
Correct |
227 ms |
76108 KB |
Output is correct |
98 |
Correct |
404 ms |
89476 KB |
Output is correct |
99 |
Correct |
313 ms |
89016 KB |
Output is correct |
100 |
Correct |
338 ms |
90052 KB |
Output is correct |
101 |
Correct |
331 ms |
90824 KB |
Output is correct |
102 |
Correct |
350 ms |
91236 KB |
Output is correct |
103 |
Correct |
384 ms |
100296 KB |
Output is correct |
104 |
Correct |
362 ms |
105648 KB |
Output is correct |
105 |
Correct |
370 ms |
102732 KB |
Output is correct |
106 |
Correct |
336 ms |
92108 KB |
Output is correct |
107 |
Correct |
332 ms |
93380 KB |
Output is correct |
108 |
Correct |
324 ms |
90440 KB |
Output is correct |
109 |
Correct |
310 ms |
93304 KB |
Output is correct |
110 |
Correct |
68 ms |
43724 KB |
Output is correct |
111 |
Correct |
51 ms |
43308 KB |
Output is correct |
112 |
Correct |
461 ms |
105516 KB |
Output is correct |
113 |
Correct |
235 ms |
84860 KB |
Output is correct |
114 |
Correct |
314 ms |
95776 KB |
Output is correct |
115 |
Correct |
75 ms |
66384 KB |
Output is correct |
116 |
Correct |
301 ms |
85140 KB |
Output is correct |
117 |
Correct |
1131 ms |
136504 KB |
Output is correct |
118 |
Correct |
117 ms |
65480 KB |
Output is correct |
119 |
Correct |
116 ms |
65416 KB |
Output is correct |
120 |
Correct |
44 ms |
46428 KB |
Output is correct |
121 |
Correct |
401 ms |
88160 KB |
Output is correct |
122 |
Correct |
405 ms |
88348 KB |
Output is correct |
123 |
Correct |
239 ms |
88948 KB |
Output is correct |
124 |
Correct |
232 ms |
86912 KB |
Output is correct |
125 |
Correct |
269 ms |
90732 KB |
Output is correct |
126 |
Correct |
796 ms |
140100 KB |
Output is correct |
127 |
Correct |
363 ms |
109236 KB |
Output is correct |
128 |
Correct |
245 ms |
106664 KB |
Output is correct |
129 |
Correct |
276 ms |
109360 KB |
Output is correct |
130 |
Correct |
263 ms |
107988 KB |
Output is correct |