1 solutions
-
0
#include<bits/stdc++.h> using namespace std; int d,i,id; bool tree[10000010]; int main() { cin>>d>>i; for(int j=1;j<=i;j++) { id=1; while(id<=pow(2,d-1)-1) { if(tree[id]) { tree[id]=!tree[id]; id=id*2+1; } else { tree[id]=!tree[id]; id=id*2; } } } cout<<id; return 0; }
Information
- ID
- 1023
- Time
- 1000ms
- Memory
- 256MiB
- Difficulty
- 5
- Tags
- (None)
- # Submissions
- 6
- Accepted
- 3
- Uploaded By