# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
406573 | Ronin13 | Rack (eJOI19_rack) | C++14 | 12 ms | 6592 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
#define ll long long
#define f first
#define s second
#define pii pair<int,int>
#define pll pair<ll,ll>
#define ull unsigned ll
#define pb push_back
#define epb emplace_back
#define INF 1e9+1;
using namespace std;
void solve(){
int n,k;cin>>n>>k;
vector<int>vec;
vec.pb(1);
vec.pb((1<<(n-1))+1);
int j=(1<<(n-1));
j/=2;
while(j){
vector<int>add;
for(int i=0;i<vec.size();i++){
add.pb(vec[i]+j);
}
for(int to:add)vec.pb(to);
j/=2;
}
cout<<vec[k-1]<<' ';
}
int main(){
int t;t=1;
while(t--){
solve();
}
}
컴파일 시 표준 에러 (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... |