# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
626907 | chonka | Swap (BOI16_swap) | C++17 | 746 ms | 3652 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
using namespace std ;
typedef long long ll ;
const int MAXN = 2e5 + 7 ;
int n ;
int a[ MAXN ] ;
int get ( int wh , int val ) {
if ( 2 * wh > n ) { return wh ; }
if ( 2 * wh == n ) {
if ( val < a[ 2 * wh ] ) { return wh ; }
return 2 * wh ;
}
if ( val < a[ 2 * wh ] && val < a[ 2 * wh + 1 ] ) { return wh ; }
if ( a[ 2 * wh ] < val && a[ 2 * wh ] < a[ 2 * wh + 1 ] ) {
return get ( 2 * wh , val ) ;
}
int x = a[ 2 * wh ] ;
if ( x < val ) {
int sr1 = get ( 2 * wh , x ) ;
int sr2 = get ( 2 * wh + 1 , x ) ;
if ( sr1 < sr2 ) {
return get ( 2 * wh + 1 , val ) ;
}
else {
return get ( 2 * wh , val ) ;
}
}
# | 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... |