QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#509656 | #5722. Rainbow Strings | exxqfu | AC ✓ | 0ms | 1408kb | C++14 | 708b | 2024-08-08 16:58:53 | 2024-08-08 16:58:53 |
Judging History
answer
#include <cstdio>
#define rep(i, d, u) for(int i = d; i <= u; ++i)
int sred(char *st) {
int ch, re = 0;
do {
ch = getchar();
} while(ch < 'a' || 'z' < ch);
do {
st[++re] = ch;
} while('a' <= (ch = getchar()) && ch <= 'z');
return re;
}
void uwit(int da) {
int ch[21], cn = 0;
do {
ch[++cn] = da % 10;
} while(da /= 10);
do {
putchar('0' ^ ch[cn]);
} while(--cn);
}
const int _maxn = 100011, _maxb = 31, _mods = 11092019;
char s[_maxn];
int slen, tons[_maxb], rans = 1;
int main() {
slen = sred(s);
rep(i, 1, slen) {
++tons[s[i] - 'a'];
}
rep(i, 0, _maxb - 1) {
rans = 1ll * rans * (tons[i] + 1) % _mods;
}
uwit(rans), putchar('\n');
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 1296kb
input:
aab
output:
6
result:
ok single line: '6'
Test #2:
score: 0
Accepted
time: 0ms
memory: 1216kb
input:
icpcprogrammingcontest
output:
209952
result:
ok single line: '209952'
Test #3:
score: 0
Accepted
time: 0ms
memory: 1236kb
input:
wfbratrxyl
output:
768
result:
ok single line: '768'
Test #4:
score: 0
Accepted
time: 0ms
memory: 1288kb
input:
ffpndpjpqdcjatmmmumgainqrndlqweqxvbpbrltgydgylimfvkjheffnbmjsvggttimggjyhqidxbttxwxhijpcrvvqfwzlnvth
output:
9665205
result:
ok single line: '9665205'
Test #5:
score: 0
Accepted
time: 0ms
memory: 1312kb
input:
kbowzshszvwquuxtmwwgsqsirkpygewqjuwxhszfxnhjkmfdgnyivziiaxkktbyrxtwsvyphakswxzplyuxlhwmtrydwsbrnxmzapbvxwhicfjtdptdjugnufgtxjxlwzfaabshhuijozarfbzljfkjmljrekjluhualmwyxifjweldnfyqoedkpcxtxxzmrmbjxydnzfmwtwhmkvyijmhqalwljynfdgxqudinlcdauoxxildahtsmnaxofynhynvdykjewxjvwwugvizsahunqxmgyvbiceimowcmnqsxf...
output:
4419330
result:
ok single line: '4419330'
Test #6:
score: 0
Accepted
time: 0ms
memory: 1328kb
input:
mzbviphgquwqaedtattkslavwgsneqthflegbrkgwuaprmdrzpddumfiermzrzqxvxamhywkbxluagikgucifldyakwgqevahuygpgqmbccmylsyviddnextalmqohovwmwnrvqlzbzmrmruweaadejjmapnzaxtbkvplmigsjllkikzkmtdpsvxktzojwqgcdknjyvlzpyzslrvrmbqjlhorzbhuajwgslxypfdwgshncirkputflgdevpmdtxeealqyaiuihrvdgusoyeoaljzuvwkmdzriljtmgvmbipa...
output:
9554832
result:
ok single line: '9554832'
Test #7:
score: 0
Accepted
time: 0ms
memory: 1408kb
input:
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
output:
100001
result:
ok single line: '100001'
Test #8:
score: 0
Accepted
time: 0ms
memory: 1408kb
input:
fazovpermsbmyyihhkanlyddpistdwfvvqzkwqyjrenwafxiorgugrdbrjgtowmgchqacobrtgdpadwuptvfrsdaszyweyhqcfqhbisbjjwbpnbczcxqtpwfshxwrpizfmdkkiyanttxstwyovfdkiyhkoapywbobjnwbmlcamgugrkvxkmrqygpakncptsqzfrxmtnliswfqpjkxigdktmgzelmztjqiwslfpjtolvmkungwhdjyjxdlabwhofyzxmmxubbkeexszeylsfethtwqnhctsjwlmhhtmkanatx...
output:
9874824
result:
ok single line: '9874824'