Ankit_132

B

Aug 31st, 2023
299
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.47 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 pb     push_back
  9.  
  10. int main()
  11. {
  12.     _test
  13.     {
  14.         string a, b;
  15.         cin>>a>>b;
  16.  
  17.         int f = 0;
  18.  
  19.         for(int i=0; i<a.size()-1; i++)
  20.             f |= (a[i]==b[i] && a[i]=='0' &&
  21.                   a[i+1]==b[i+1] && a[i+1]=='1');
  22.  
  23.         if(f)       cout<<"YES\n";
  24.         else        cout<<"NO\n";
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment