救命
  • 板块灌水区
  • 楼主__Function__
  • 当前回复0
  • 已保存回复0
  • 发布时间2024/10/1 20:42
  • 上次更新2024/10/1 23:41:43
查看原帖
救命
1324175
__Function__楼主2024/10/1 20:42

模拟赛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;
}

已无语

2024/10/1 20:42
加载中...