Loading

Codeforces Round #730 (Div. 2) D1. RPD and Rap Sheet (Easy Version)(位运算/交互)

include <bits/stdc++.h>

using namespace std;
int n, k;
void process() {
int r;
cin >> r;
if(r == 1) return;
for(int i = 1; i < n; i++) {
cout << (i ^ (i - 1)) << endl;
cout.flush();
cin >> r;
if(r == 1) return;
}
}

int main() {
int t;
cin >> t;
while(t--) {
cin >> n >> k;
cout << 0 << endl;
cout.flush();
process();
}
return 0;
}

posted @ 2021-07-13 15:58  脂环  阅读(35)  评论(0编辑  收藏  举报