-
Notifications
You must be signed in to change notification settings - Fork 0
/
cf a new.cpp
53 lines (40 loc) · 847 Bytes
/
cf a new.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#define ll long long int
#define pb push_back
#define mk make_pair
#define MOD 1000000007
#define f(i, a, b) for (int i = a; i < b; ++i)
#define rf(i, a, b) for (int i = a; i >= b; --i)
#define fi(n, a) \
vector<ll> a(n); \
for (int i = 0; i < n; ++i) \
cin >> a[i];
// #include<iostream>
#include <bits/stdc++.h>
using namespace std;
void solve()
{
string a, b;
cin >> a >> b;
if (a == b){
cout << "YES" << endl;
return;
}
bool flag = false;
f(i, 0 , a.size()-1){
if(a[i] == '0' && b[i] == '0' && a[i+1] == '1' && b[i+1] == '1') flag = true;
}
if (flag)
cout << "YES" << endl;
else
cout << "NO" << endl;
}
int main()
{
int t;
cin >> t;
while (t--)
{
solve();
}
return 0;
}