QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#288053#5254. DifferencesAtomAlpacaWA 246ms35196kbC++14716b2023-12-21 17:29:162023-12-21 17:29:18

Judging History

你现在查看的是最新测评结果

  • [2023-12-21 17:29:18]
  • 评测
  • 测评结果:WA
  • 用时:246ms
  • 内存:35196kb
  • [2023-12-21 17:29:16]
  • 提交

answer

#include <bits/stdc++.h>

typedef long long ll;
const int MAX = 1e5 + 5;
const ll MOD = 1e17 + 3;
const ll P = 79;

std::string s[MAX];
ll n, m, k, sum;
ll w[MAX], f[MAX][5];
std::mt19937 rnd(time(0));

int main()
{
	scanf("%lld%lld%lld", &n, &m, &k); w[0] = 1;
	for (int i = 1; i <= n; ++i) { w[i] = w[i - 1] * P % MOD; sum = (sum + w[i]) % MOD; }
	for (int i = 1; i <= n; ++i)
	{
		std::cin >> s[i];
		for (int j = 0; j < m; ++j)
		{
			f[j][s[i][j] - 'A'] = (f[j][s[i][j] - 'A'] + w[i]) % MOD;
		}
	}

	for (int i = 1; i <= n; ++i)
	{
		ll res = sum * m;
		for (int j = 0; j < m; ++j)
		{
			res = (res - f[j][s[i][j] - 'A'] + MOD) % MOD;
		}
		if (res == (sum - w[i]) * k % MOD) { printf("%d", i); break; }
	}
}

詳細信息

Test #1:

score: 0
Wrong Answer
time: 246ms
memory: 35196kb

input:

3585 4096 2048
ABBBBBBAABAAAAAAAAAAAAABAABABBBABABAAAAABABAAAABAABAABBABBAABAABABBABAABBABBABABABBAAAABBABAABBBBABBBAABBBBBABAABAAABAAABBBBAAAABAABAABABABABBBBBABAAABAAABBAABABBABAABBAABBAABABBBBAABAAAABAABBABAAABBAAAAAABAABBABBABAABABBBAABABBABABBBAAAAABBBABABABBAABAAAABBBBABABAABBBABABABBAABBBABAB...

output:


result:

wrong answer 1st lines differ - expected: '1397', found: ''