Advertisement
Saleh127

Light OJ 1247 / Game Theory

Feb 22nd, 2023
690
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.89 KB | None | 0 0
  1. /***
  2.  created: 2023-01-11-23.19.07
  3. ***/
  4.  
  5. #include <bits/stdc++.h>
  6. #include <ext/pb_ds/assoc_container.hpp>
  7. #include <ext/pb_ds/tree_policy.hpp>
  8. using namespace std;
  9. using namespace __gnu_pbds;
  10. template<typename U> using ordered_set=tree<U, null_type,less<U>,rb_tree_tag,tree_order_statistics_node_update>;
  11. #define ll long long
  12. #define all(we) we.begin(),we.end()
  13. #define test int tt; cin>>tt; for(int cs=1;cs<=tt;cs++)
  14. #define nl '\n'
  15.  
  16. int main()
  17. {
  18.     ios_base::sync_with_stdio(0);
  19.     cin.tie(0);
  20.     cout.tie(0);
  21.  
  22.     test
  23.     {
  24.         ll n,m,i,j,k=0,l=0;
  25.         cin>>n>>m;
  26.         for(i=1;i<=n*m;i++)
  27.         {
  28.             cin>>j;
  29.             k+=j;
  30.             if(i%m==0)
  31.             {
  32.                 l^=k;
  33.                 k=0;
  34.             }
  35.         }
  36.         if(l) cout<<"Case "<<cs<<": Alice"<<nl;
  37.         else cout<<"Case "<<cs<<": Bob"<<nl;
  38.     }
  39.     return 0;
  40. }
  41.  
  42.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement