| 比赛 | EYOI常规赛 4th | 评测结果 | AAAAAAAAAAAAAAAAAAAA |
|---|---|---|---|
| 题目名称 | 格雷码 | 最终得分 | 100 |
| 用户昵称 | ムラサメ | 运行时间 | 0.000 s |
| 代码语言 | C++ | 内存使用 | 0.00 MiB |
| 提交时间 | 2022-05-27 21:15:32 | ||
#include<bits/stdc++.h>
using namespace std;
unsigned long long n,k,c,b;
int ans[107],t;
int main(){
freopen("code.in","r",stdin);
freopen("code.out","w",stdout);
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
cin>>n>>k;
c=(k>>1);
b=(k^c);
while(b!=0){
ans[++t]=(b&1);
b=(b>>1);
}
for (int i = n;i > 0;i --){
cout<<ans[i];
}
return 0;
}