VJ(第十八次训练赛 )
a
ac代码
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
int flag=0;
string s1,s2;
cin>>s1>>s2;
for(int i=0;i<=n-1;i++)
{
if(flag==1) break;
if(s1[i]=='l' || s1[i]=='1'){
if(s2[i]!='l' && s2[i]!='1') flag=1;
}
else if(s1[i]=='o' || s1[i]=='0')
{
if(s2[i]!='0' && s2[i]!='o') flag=1;
}
else if(s1[i]!=s2[i]) flag=1;
}
if(flag==1) cout<<"No"<<endl;
else cout<<"Yes"<<endl;
return 0;
}