Ankit_132

CodeChef Streak

Jun 14th, 2023
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.96 KB | None | 0 0
  1.  
  2. #include <bits/stdc++.h>
  3.  
  4. using namespace std;
  5.  
  6. #define ll     long long
  7. #define _test   int _TEST; cin>>_TEST; while(_TEST--)
  8. #define ff     first
  9. #define ss     second
  10. #define pb     push_back
  11. #define ppb    pop_back
  12.  
  13.  
  14. int main()
  15. {
  16.     ios_base::sync_with_stdio(false);
  17.     cin.tie(NULL);
  18.     cout.tie(NULL);
  19.  
  20.     _test
  21.     {
  22.         int n;
  23.         cin>>n;
  24.  
  25.         vector<int> a(n), b(n);
  26.         for(auto &e: a)  cin>>e;
  27.         for(auto &e: b)  cin>>e;
  28.  
  29.         int x=0, y=0;
  30.         int c = 0;
  31.  
  32.         for(auto e: a)
  33.         {
  34.             if(e > 0)       c++;
  35.             else            c = 0;
  36.  
  37.             x = max(x, c);
  38.         }
  39.  
  40.         c = 0;
  41.  
  42.         for(auto e: b)
  43.         {
  44.             if(e > 0)       c++;
  45.             else            c = 0;
  46.  
  47.             y = max(y, c);
  48.         }
  49.  
  50.         if(x > y)       cout<<"Om\n";
  51.         else if(x == y) cout<<"Draw\n";
  52.         else            cout<<"Addy\n";
  53.     }
  54. }
  55.  
Advertisement
Add Comment
Please, Sign In to add comment