# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
735225 | MrAndria | Rack (eJOI19_rack) | C++14 | 1 ms | 212 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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>=1;i--){
p1=pow(2,i);
// cout<<"21321213"<<endl;
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<<endl;
return 0;
}
}
}
}
if(k==2){
cout<<2<<endl;
}else{
cout<<1<<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... |