제출 #334809

#제출 시각아이디문제언어결과실행 시간메모리
334809limabeansRack (eJOI19_rack)C++17
40 / 100
1 ms384 KiB
#include <bits/stdc++.h> using namespace std; template<typename T> void out(T x) { cout << x << endl; exit(0); } #define watch(x) cout << (#x) << " is " << (x) << endl using ll = long long; const ll mod = 1e9+7; ll f(ll n, ll k) { if (n==0) return 1; if (n<=62 && k>(1ll<<n)/2) { return 2ll*f(n-1,k-(1ll<<n)/2); } else { return 2ll*f(n-1,k)-1; } } int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); ll n,k; cin>>n>>k; ll res = f(n,k); res %= mod; res += mod; res %= mod; cout<<res; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...