Ankit_132

A

May 27th, 2023 (edited)
262
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.57 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. #define ll     long long
  6. #define ff     first
  7. #define ss     second
  8. #define pb     push_back
  9.  
  10. int main()
  11. {
  12.  
  13.      int n;
  14.      string s, t;
  15.      cin>>n>>s>>t;
  16.  
  17.      int f = 1;
  18.  
  19.      for(int i=0; i<n; i++)
  20.      {
  21.          f &= (s[i]==t[i] || (s[i]=='1' && t[i]=='l')
  22.                             || (s[i]=='0' && t[i]=='o')
  23.                              || (t[i]=='1' && s[i]=='l')
  24.                              || (t[i]=='0' && s[i]=='o'));
  25.      }
  26.  
  27.      if(f)      cout<<"Yes\n";
  28.      else       cout<<"No\n";
  29. }
  30.  
Advertisement
Add Comment
Please, Sign In to add comment