# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
929469 |
2024-02-18T05:46:15 Z |
hngr |
Rack (eJOI19_rack) |
C++14 |
|
1 ms |
504 KB |
#include <iostream>
#include <vector>
#include <set>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <string>
#define int long long
const int mod = 1e9+7;
using namespace std;
int32_t main() {
int n, k; cin >> n >> k;
vector<int> y(n+1, 1);
for(int i = 1; i <= n; i ++) y[i] = y[i-1] * 2;
int ind = k;
ind --;
int ans = 1;
while(ind != 0){
int i = log(ind);
(ans += (y[n-i-1] % mod)) %= mod;
ind -= y[i];
}
cout << ans;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
504 KB |
Output is correct |
2 |
Incorrect |
1 ms |
444 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
504 KB |
Output is correct |
2 |
Incorrect |
1 ms |
444 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
504 KB |
Output is correct |
2 |
Incorrect |
1 ms |
444 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |