| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 622628 | froxyy | Rack (eJOI19_rack) | C++14 | 107 ms | 102400 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define fast ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
typedef long long ll;typedef long double ld;typedef pair<int,int> pii;
#define F first
#define S second
#define PB push_back
#define MP make_pair
const ll mod = 1e9+7, N = 2e6+7, M = 2e6+7, INF = INT_MAX/10;
ll powe(ll x, ll y){ x = x%mod, y=y%(mod-1);ll ans = 1;while(y>0){if (y&1){ans = (1ll * x * ans)%mod;}y>>=1;x = (1ll * x * x)%mod;}return ans;}
void solve(){
ll n, k;
cin >> n >> k;
vector<ll> v = {1};
vector<ll> ans = {1};
ll x = pow(2, n-1);
while(x >= 1 || ans.size() < k)
{
for(size_t i=0; i<v.size(); i++)
ans.PB(v[i] + x);
x /= 2;
for(size_t i=v.size(); i<ans.size(); i++)
v.PB(ans[i]);
}
cout << ans[k-1] << '\n';
//for(size_t i=0; i<ans.size(); i++)
//cout << ans[i] << ' ';
}
signed main(){
fast;
int t = 1;
//cin >> t;
while(t--){
solve();
}
return 0;
}
컴파일 시 표준 에러 (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... | ||||
