[愚人节 2025 D] 今年欢笑复明年,不知退役在眼前 1
You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.
Background
今年欢笑复明年,不知退役在眼前。
Description
你需要通过给出的 实现一个 Hash 函数:
int f(char c) { return 'A' <= c && c <= 'Z' ? c - 'A' + 1 : c - 'a' + 1 + 26; }
int Hash(string &s, const int b, const int m)
{
int res = 0;
for (int i = 0; i < s.size(); i++)
res = (1ll * res * b + f(s[i])) % m;
return res;
}
有 个询问,每次给出一个整数 ,保证 。你需要找到一个合理的 的映射 ,求出 。
保证 的映射 的 字符集为全体大写拉丁字母和全体小写拉丁字母。
Format
Input
一行,三个整数,。
接下来 行,每行一个整数 。
Output
行,每行一个 Hash 值。
Samples
20 53 97
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
8
67
89
40
2
3
14
15
6
94
90
43
91
72
16
19
3
0
11
89
Limitation
对于所有测试数据,满足 ,,,。
[CZR-(-001)] CZOJ 2025 愚人节比赛
- 状态
- 已结束
- 规则
- ACM/ICPC
- 题目
- 13
- 开始于
- 2025-3-12 14:00
- 结束于
- 2025-4-6 14:00
- 持续时间
- 600 小时
- 主持人
- 参赛人数
- 110