#include <bits/stdc++.h>
using namespace std;
int main(){
int n, k;
cin >> n >> k;
vector<bool> lvl(n);
for(int i=0; i<k; i++){
for(int j=0; j<n; j++){
if(i%int(pow(2, j)) == 0) lvl[j] = !lvl[j];
}
}
int o1 = 1;
for(int i=0; i<n; i++) o1 += !lvl[i] * pow(2, n-i-1);
cout << o1;
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
436 KB |
Output is correct |
3 |
Correct |
1 ms |
500 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
436 KB |
Output is correct |
3 |
Correct |
1 ms |
500 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
344 KB |
Output is correct |
7 |
Correct |
1 ms |
348 KB |
Output is correct |
8 |
Correct |
21 ms |
348 KB |
Output is correct |
9 |
Correct |
59 ms |
408 KB |
Output is correct |
10 |
Correct |
86 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
436 KB |
Output is correct |
3 |
Correct |
1 ms |
500 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
344 KB |
Output is correct |
7 |
Correct |
1 ms |
348 KB |
Output is correct |
8 |
Correct |
21 ms |
348 KB |
Output is correct |
9 |
Correct |
59 ms |
408 KB |
Output is correct |
10 |
Correct |
86 ms |
348 KB |
Output is correct |
11 |
Execution timed out |
1068 ms |
348 KB |
Time limit exceeded |
12 |
Halted |
0 ms |
0 KB |
- |