# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
548687 |
2022-04-14T09:12:50 Z |
Stavab |
Rack (eJOI19_rack) |
C++14 |
|
1 ms |
300 KB |
#include <bits/stdc++.h>
using namespace std;
int i, j, k;
void narrow (int lower, int upper)
{
if (k % 2 == 0)
{
lower = (upper + lower) / 2 + 1;
k /= 2;
}
else
{
upper = (upper + lower) / 2;
k /= 2;
k++;
}
i = lower;
j = upper;
}
int main()
{
int n;
cin >> n >> k;
i = 1;
j = pow(2, n);
while (j != i)
{
narrow(i, j);
}
cout << i;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
212 KB |
Output is correct |
5 |
Correct |
1 ms |
212 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
212 KB |
Output is correct |
5 |
Correct |
1 ms |
212 KB |
Output is correct |
6 |
Correct |
1 ms |
212 KB |
Output is correct |
7 |
Correct |
1 ms |
300 KB |
Output is correct |
8 |
Correct |
1 ms |
212 KB |
Output is correct |
9 |
Correct |
1 ms |
212 KB |
Output is correct |
10 |
Correct |
1 ms |
212 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
212 KB |
Output is correct |
5 |
Correct |
1 ms |
212 KB |
Output is correct |
6 |
Correct |
1 ms |
212 KB |
Output is correct |
7 |
Correct |
1 ms |
300 KB |
Output is correct |
8 |
Correct |
1 ms |
212 KB |
Output is correct |
9 |
Correct |
1 ms |
212 KB |
Output is correct |
10 |
Correct |
1 ms |
212 KB |
Output is correct |
11 |
Incorrect |
1 ms |
300 KB |
Output isn't correct |
12 |
Halted |
0 ms |
0 KB |
- |