# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
631235 | smartmonky | Rack (eJOI19_rack) | C++14 | 0 ms | 0 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 <bits/stdc++.h>
#define ll long long
#define pb push_back
#define int ll
using namespace std;
const int mod=1e9+7;
main(){
int n,k;
cin >>n >>k;
map<int,int> v,ans;
v[1]=1;
ans[1]=1;
v[2]=(x/2+1)%mod;
ans[2]=(v[2])%mod;
int cnt=2;
int s=3;
for(int i=x/4;i>=1;i/=2){
for(int j=1;j<=cnt;j++){
v[cnt+j]=(v[j]+i)%mod;
ans[s]=v[cnt+j];
s++;
}
cnt*=2;
}
cout<<ans[k];
}