This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |