Submission #1045933

#TimeUsernameProblemLanguageResultExecution timeMemory
1045933marRack (eJOI19_rack)C++14
40 / 100
0 ms348 KiB
#include <bits/stdc++.h> using namespace std; const int mod=1000000007; typedef long long ll; ll dp(ll n, ll k, ll val){ ll ans = 0; if(n== 0)return 0; if(n<64){ ll po = pow(2ull, n-1); if(po < k){ ans+= val; ans+= dp(n-1, k-po, val*2); return ans; } } ans += dp(n-1, k, val*2); return ans; } int main(){ ll n, k; cin>>n>>k; ll ans = dp(n, k, 1)%mod; cout<<ans+1<<endl; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...