# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
216707 |
2020-03-27T20:54:13 Z |
MODDI |
Rack (eJOI19_rack) |
C++14 |
|
5 ms |
384 KB |
#include <bits/stdc++.h>
using namespace std;
int MOD= 1e9 + 7;
int main()
{
int n, k;
cin>>n>>k;
vector<int> pow_two;
pow_two.push_back(1);
long long at=1;
for(int i=1;i<n;i++)
{
at*=2;
at %= MOD;
pow_two.push_back(at);
}
int rez=1;
int step=1;
while(k!=1)
{
if(k%2==0)
{
rez+=pow_two[n-step];
k-=k/2;
step++;
}
else {
step++;
k-=k/2;
}
}
cout<<rez<<endl;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
256 KB |
Output is correct |
2 |
Correct |
4 ms |
384 KB |
Output is correct |
3 |
Correct |
4 ms |
256 KB |
Output is correct |
4 |
Correct |
4 ms |
256 KB |
Output is correct |
5 |
Correct |
4 ms |
256 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
256 KB |
Output is correct |
2 |
Correct |
4 ms |
384 KB |
Output is correct |
3 |
Correct |
4 ms |
256 KB |
Output is correct |
4 |
Correct |
4 ms |
256 KB |
Output is correct |
5 |
Correct |
4 ms |
256 KB |
Output is correct |
6 |
Correct |
5 ms |
256 KB |
Output is correct |
7 |
Correct |
5 ms |
384 KB |
Output is correct |
8 |
Correct |
4 ms |
256 KB |
Output is correct |
9 |
Correct |
5 ms |
384 KB |
Output is correct |
10 |
Correct |
4 ms |
256 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
256 KB |
Output is correct |
2 |
Correct |
4 ms |
384 KB |
Output is correct |
3 |
Correct |
4 ms |
256 KB |
Output is correct |
4 |
Correct |
4 ms |
256 KB |
Output is correct |
5 |
Correct |
4 ms |
256 KB |
Output is correct |
6 |
Correct |
5 ms |
256 KB |
Output is correct |
7 |
Correct |
5 ms |
384 KB |
Output is correct |
8 |
Correct |
4 ms |
256 KB |
Output is correct |
9 |
Correct |
5 ms |
384 KB |
Output is correct |
10 |
Correct |
4 ms |
256 KB |
Output is correct |
11 |
Incorrect |
5 ms |
384 KB |
Output isn't correct |
12 |
Halted |
0 ms |
0 KB |
- |