模拟赛T2爆0!!!错4个测试点》?。。
#include<bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int dp[N];
signed main()
{
memset(dp,0,sizeof(dp));
int n, ans = 0;
cin >> n;
string a[N];
int l;
for(int i = 1; i <= n; i++) {
cin >> a[i];
l = a[i].size();
}
for(int i = 2; i <= n; i++){
for(int k = 0; k < l; k ++)
if(a[i][k] == a[1][k])
dp[i] ++;
if(dp[i] > l * 0.5)
ans ++;
}
if(ans == 0)
cout << "0" << endl <<"Good job!";
else if(ans > 0)
cout << ans + 1 << endl <<"Make persistent efforts.";
return 0;
}
已无语