# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
731033 |
2023-04-26T20:10:34 Z |
aykhn |
Rack (eJOI19_rack) |
C++14 |
|
9 ms |
8792 KB |
#include <bits/stdc++.h>
/*
author: aykhn
4/24/2023
*/
using namespace std;
typedef long long ll;
#define OPT ios_base::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0)
#define pii pair<int,int>
#define pll pair<ll,ll>
#define all(v) v.begin(), v.end()
#define mpr make_pair
#define pb push_back
#define ts to_string
#define fi first
#define se second
#define inf 0x3F3F3F3F
#define infll 0x3F3F3F3F3F3F3F3FLL
#define bpc __builtin_popcount
#define print(v) for(int i = 0; i < v.size(); i++) cout << v[i] << " "; cout<<endl;
const ll mod = 1000000007;
vector<int> v(1048577, 0);
int n, k, val;
int ans;
void f(int i, int from)
{
if (val == k) ans = i;
v[i] = val++;
int pow = (1 << n);
while (pow > from)
{
f(i + pow, pow);
pow >>= 1;
}
}
int main()
{
OPT;
cin >> n >> k;
n--;
val = 1;
f(1, 0);
cout << v[k] << endl;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
4436 KB |
Output is correct |
2 |
Correct |
3 ms |
4436 KB |
Output is correct |
3 |
Correct |
3 ms |
4368 KB |
Output is correct |
4 |
Correct |
3 ms |
4308 KB |
Output is correct |
5 |
Correct |
2 ms |
4348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
4436 KB |
Output is correct |
2 |
Correct |
3 ms |
4436 KB |
Output is correct |
3 |
Correct |
3 ms |
4368 KB |
Output is correct |
4 |
Correct |
3 ms |
4308 KB |
Output is correct |
5 |
Correct |
2 ms |
4348 KB |
Output is correct |
6 |
Correct |
2 ms |
4436 KB |
Output is correct |
7 |
Correct |
2 ms |
4436 KB |
Output is correct |
8 |
Correct |
3 ms |
4436 KB |
Output is correct |
9 |
Correct |
5 ms |
4440 KB |
Output is correct |
10 |
Correct |
9 ms |
4436 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
4436 KB |
Output is correct |
2 |
Correct |
3 ms |
4436 KB |
Output is correct |
3 |
Correct |
3 ms |
4368 KB |
Output is correct |
4 |
Correct |
3 ms |
4308 KB |
Output is correct |
5 |
Correct |
2 ms |
4348 KB |
Output is correct |
6 |
Correct |
2 ms |
4436 KB |
Output is correct |
7 |
Correct |
2 ms |
4436 KB |
Output is correct |
8 |
Correct |
3 ms |
4436 KB |
Output is correct |
9 |
Correct |
5 ms |
4440 KB |
Output is correct |
10 |
Correct |
9 ms |
4436 KB |
Output is correct |
11 |
Runtime error |
9 ms |
8792 KB |
Execution killed with signal 11 |
12 |
Halted |
0 ms |
0 KB |
- |