# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1119003 | Dan4Life | Rack (eJOI19_rack) | C++17 | 146 ms | 504 KiB |
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 <iostream>
using namespace std;
using ll=long long;
ll n,k,l,r,M=1e9+7;
ll p(ll b){
if(!b)return 1;
ll x=p(b/2);x*=x;x%=M;
return (x*(b&1?2:1))%M;
}
main(){
cin>>n>>k,l=1,r=p(n);
while(n--){
if(k%2)k++,r=(r+M-p(n))%M;
else l=(l+p(n))%M;k/=2;
}
cout<<l;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |