QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#509656#5722. Rainbow StringsexxqfuAC ✓0ms1408kbC++14708b2024-08-08 16:58:532024-08-08 16:58:53

Judging History

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

  • [2024-08-08 16:58:53]
  • 评测
  • 测评结果:AC
  • 用时:0ms
  • 内存:1408kb
  • [2024-08-08 16:58:53]
  • 提交

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;
}

Details

Tip: Click on the bar to expand more detailed information

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'