fields () content ++ 算法 can 不同 noi algorithm
此文为博主原创题解,转载时请通知博主,并把原文链接放在正文醒目位置。
题目链接:http://oj.noi.cn/oj/#main/show/1172
分析:
挺水的_(:з」∠)_乘法原理。眼花了以为这是个不错的题...
AC代码:
- #include<cstdio>
- #include<algorithm>
- #include<cstring>
- #include<cmath>
- const int MOD = 10007;
- char s[200];
- long long ans = 1;
- int main()
- {
- scanf("%s",s);
- int n = strlen(s);
- for(int i = 0;i < n;++ i)
- ans = ans*(s[i]-‘a‘+1)%MOD;
- printf("%lld\n",ans);
- return 0;
- }
CCF NOI 1172 单词数 题解
来源: http://www.bubuko.com/infodetail-2357735.html