Submission #967756

#TimeUsernameProblemLanguageResultExecution timeMemory
967756inesfiRack (eJOI19_rack)C++14
100 / 100
6 ms600 KiB
#include<bits/stdc++.h> using namespace std; #define int long long #define endl "\n" const int TAILLEMAXI=1000*1000+2,MODULO=1000*1000*1000+7; int puiss,nbamettre,rep,ec; int droite[TAILLEMAXI]; signed main(){ ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); cin>>puiss>>nbamettre; for (int i=0;i<puiss;i++){ if (nbamettre%2==0){ droite[i]=1; } nbamettre+=1; nbamettre/=2; } ec=1; rep=1; for (int i=puiss-1;i>=0;i--){ if (droite[i]==1){ rep+=ec; } ec*=2; ec%=MODULO; rep%=MODULO; } cout<<rep<<endl; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...