Submission #446746

#TimeUsernameProblemLanguageResultExecution timeMemory
446746osmanallazovRack (eJOI19_rack)C++14
100 / 100
10 ms7904 KiB
#include <bits/stdc++.h> #define mod 1000000007 #define ll long long using namespace std; int main() { ll n,k; cin>>n>>k; ll a[n+1]; a[0]=1; for(int i=1;i<=n;i++){ a[i]=a[i-1]*2%mod; } ll res=0; while(n!=0){ if(k%2==0){ res=(res+a[n-1])%mod; } n--; k=(k+1)/2; } cout<<(res+1)%mod; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...