Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- #define multi true
- using namespace std;
- int t = 1, n, k, res, sta;
- void solve() {
- res = 0;
- cin >> n >> k;
- for (int i = 0; i < n; i++) {
- cout << (i ^ res) << endl;
- cin >> sta;
- if (sta == 1) break;
- res ^= i ^ res;
- }
- return;
- }
- int main() {
- #ifndef ONLINE_JUDGE
- // freopen("in.txt", "r", stdin);
- // freopen("out.txt", "w", stdout);
- #endif
- if (multi) cin >> t;
- while (t--) solve();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment