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 lalala ios_base::sync_with_stdio(false);cin.tie(NULL);
#define endl "\n"
#define ll long long
#define pb push_back
#define mod 1000000007
inline ll int hmm(ll int l,ll int r,ll int k){
if(l==r)return l%mod;
ll int m=(l+r)/2;
m=m%mod;
//cout<<l<<" "<<r<<" "<<k<<endl;
if(k%2==0&&k!=0){
return hmm(m+1,r,k/2);
}
else return hmm(l,m,k/2+1);
}
int main(){
lalala;
ll int n,k;cin>>n>>k;
ll int kalan=1;
while(n>10){
kalan*=(((1 <<10))%mod);
kalan%=mod;
n-=10;
}
if(n){
kalan*=((1<<n)%mod);
kalan%=mod;
}
cout<<hmm(1,kalan,k)<<endl;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |