이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "bits/stdc++.h"
using namespace std;
#define ll long long
#define endl '\n'
const ll MOD = 998244353;
const ll INF = 1e16;
const int INT_INF = 1e9;
const ll MAX = 1e5+1;
ll solve(ll cur, ll layer, ll ans){
if(layer == -1){
return ans;
}
if(cur % 2){
return solve((cur + 1)/2, layer-1, ans);
}
return solve((cur + 1)/2, layer-1, ans+pow(2, layer));
}
void solve(){
ll a,b;
cin>>a>>b;
cout<<solve(b, a-1, 1);
}
int main()
{
cin.tie(NULL);
ios::sync_with_stdio(NULL);
int t = 1;
//cin >> t;
while(t--){
solve();
cout<<endl;
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |