Submission #232179

#TimeUsernameProblemLanguageResultExecution timeMemory
232179PanTkdRack (eJOI19_rack)C++14
40 / 100
15 ms8192 KiB
// // main.cpp // Hanging Rack // // Created by Panagiotis Hadjicostas on 16/05/2020. // Copyright © 2020 Panagiotis Hadjicostas. All rights reserved. // #include <bits/stdc++.h> using namespace std; typedef unsigned long long ll; #define MOD ll(1e9+7) ll din[1000006]; ll reverse(ll num,ll n) { ll b=0; for (ll i = 0; i <= n-1; i++){ if((din[i]&num)==din[i]){ b+=(din[n-i-1]); if(b>MOD){ b-=MOD; } //b%=MOD; } } return b; } int main() { ll n,k;cin>>n>>k; din[0]=1; for(ll i=1;i<1000006;i++){ din[i]=(din[i-1]*2)%MOD; } cout<<(reverse(k-1, n)+1)%MOD<<endl; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...