ZhongJiaXuan

CF1543D2

May 12th, 2024
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.50 KB | Source Code | 0 0
  1. #include <bits/stdc++.h>
  2. #define multi true
  3. using namespace std;
  4. int t = 1, n, k, res, sta;
  5.  
  6. void solve() {
  7.     res = 0;
  8.     cin >> n >> k;
  9.     for (int i = 0; i < n; i++) {
  10.         cout << (i ^ res) << endl;
  11.         cin >> sta;
  12.         if (sta == 1) break;
  13.         res ^= i ^ res;
  14.     }
  15.     return;
  16. }
  17. int main() {
  18. #ifndef ONLINE_JUDGE
  19.     // freopen("in.txt", "r", stdin);
  20.     // freopen("out.txt", "w", stdout);
  21. #endif
  22.     if (multi) cin >> t;
  23.     while (t--) solve();
  24.     return 0;
  25. }
Tags: temp
Advertisement
Add Comment
Please, Sign In to add comment