# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
735231 | MrAndria | Rack (eJOI19_rack) | C++14 | 1 ms | 320 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>
using namespace std;
#define pb push_back
#define ff first
#define ss second
map <long long,long long> b;
long long n,k,p,p1,l;
int main(){
ios::sync_with_stdio(false);
cin.tie(NULL);
cin>>n>>k;
p=pow(2,n);
for(int i=n-1;i>=0;i--){
p1=pow(2,i);
for(int j=1;j<=p/2;j++){
if((j-1)%p1==0 and b[j]==0){
l++;
b[j]=1;
if(l==k){
cout<<j<<endl;
return 0;
}
l++;
if(l==k){
cout<<(j+(p/2))%(1000000007)<<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... |