Submission #624594

#TimeUsernameProblemLanguageResultExecution timeMemory
624594BlagojRack (eJOI19_rack)C++14
40 / 100
7 ms4524 KiB
#include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef long double ld; int main() { cin.tie(0); cout.tie(0); ios::sync_with_stdio(0); int n, k; cin >> n >> k; vector<int> v; v = {1, (1 << (n - 1)) + 1}; int sum = (1 << (n - 2)); while (sum > 0) { int sz = v.size(); for (int i = 0; i < sz; i++) { v.push_back(v[i] + sum); } sum /= 2; } cout << v[k - 1]; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...