QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#288053 | #5254. Differences | AtomAlpaca | WA | 246ms | 35196kb | C++14 | 716b | 2023-12-21 17:29:16 | 2023-12-21 17:29:18 |
Judging History
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: ''