C++ 代码
#include<iostream>
#include<cstring>
using namespace std;
int main()
{
double k;
string s1,s2;
int count=0;
cin>>k>>s1>>s2;
for(int i=0;i<min(s1.size(),s2.size());i++)
if(s1[i]==s2[i])
count++;
if((double)count*2/(s1.size()+s2.size())>=k)
cout<<"yes";
else cout<<"no";
return 0;
}