| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 435038 | NintsiChkhaidze | Rack (eJOI19_rack) | C++14 | 85 ms | 11128 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define left (node<<1),l,((l+r)>>1)
#define right ((node<<1)|1),((l+r)>>1) + 1,r
#define s second
#define f first
using namespace std;
vector <int> v;
map <int,int> f;
int main (){
ios_base::sync_with_stdio(0),cin.tie(NULL),cout.tie(NULL);
int n,k;
cin>>n>>k;
int a = (1<<(n - 1));
v.pb(1);
if (k == 1){
cout<<1;
return 0;
}
f[1] = 1;
while(a){
int id = 0;
while(id < v.size() && v[id] + a <= (1<<n) && !f[v[id] + a]){
f[v[id] + a] = 1;
v.pb(v[id] + a);
if (v.size() == k) {
cout<<v[id] + a;
return 0;
}
id++;
}
a/=2;
}
}
컴파일 시 표준 에러 (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... | ||||
