# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
626907 | chonka | Swap (BOI16_swap) | C++17 | 746 ms | 3652 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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... |