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> C++11
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>
#include <stdio.h>
#include <time.h>
#include <iomanip>
#include <stdlib.h>
#include <list>
#include <stack>
#include <queue>
#include <climits>
#include <map>
#include <set>
#include<sstream>
using namespace std;
typedef long long ll;
typedef pair<int,int> pi;
typedef vector<int> vi;
#define PB push_back
#define MP make_pair
vi v;
int N;
void result(int n, int s){
int temp;
if(n==1){
temp=(1+s)%1000000007;
v.PB(1+s);
temp = ll(pow(2, ll(N - 1)) + 1 + s) % 1000000007;
v.PB(temp);
}
else{
result(n-1,s);
result(n-1,s+pow(2,N-n));
}
}
int main(){
ios::sync_with_stdio(0);
cin.tie(0);
int k;
cin>>N>>k;
result(N,0);
cout<<v[k-1]<<"\n";
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |