ural 1243. Divorce of the Seven Dwarfs
1243. Divorce of the Seven Dwarfs
Memory limit: 64 MB
Input
Output
Sample
input | output |
---|---|
123456123456 |
1 |
Problem Source: Ural State University Personal Programming Contest, March 1, 2003
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <iostream>
using namespace std;
const int N = ;
int Arr[N], n;
char Str[N];
#define For(i, s, t) for(int i = (s); i <= (t); i++) int main()
{
scanf("%s", Str + );
n = strlen(Str + );
For(i, , n) Arr[i] = Str[i] - '';
int Last = ;
For(i, , n)
{
Last = Last * + Arr[i];
Last %= ;
}
cout << Last << endl;
return ;
}
ural 1243. Divorce of the Seven Dwarfs的更多相关文章
- URAL - 1243 - Divorce of the Seven Dwarfs (大数取模)
1243. Divorce of the Seven Dwarfs Time limit: 1.0 second Memory limit: 64 MB After the Snow White wi ...
- 后缀数组 POJ 3974 Palindrome && URAL 1297 Palindrome
题目链接 题意:求给定的字符串的最长回文子串 分析:做法是构造一个新的字符串是原字符串+反转后的原字符串(这样方便求两边回文的后缀的最长前缀),即newS = S + '$' + revS,枚举回文串 ...
- ural 2071. Juice Cocktails
2071. Juice Cocktails Time limit: 1.0 secondMemory limit: 64 MB Once n Denchiks come to the bar and ...
- ural 2073. Log Files
2073. Log Files Time limit: 1.0 secondMemory limit: 64 MB Nikolay has decided to become the best pro ...
- ural 2070. Interesting Numbers
2070. Interesting Numbers Time limit: 2.0 secondMemory limit: 64 MB Nikolay and Asya investigate int ...
- ural 2069. Hard Rock
2069. Hard Rock Time limit: 1.0 secondMemory limit: 64 MB Ilya is a frontman of the most famous rock ...
- ural 2068. Game of Nuts
2068. Game of Nuts Time limit: 1.0 secondMemory limit: 64 MB The war for Westeros is still in proces ...
- ural 2067. Friends and Berries
2067. Friends and Berries Time limit: 2.0 secondMemory limit: 64 MB There is a group of n children. ...
- ural 2066. Simple Expression
2066. Simple Expression Time limit: 1.0 secondMemory limit: 64 MB You probably know that Alex is a v ...
随机推荐
- Unity3D脚印6——模型动画
原地址:http://www.cnblogs.com/ybgame/archive/2013/02/21/2920009.html 如何导入一个模型,导入的模型在unity3d的project面板中是 ...
- 他们在军训,我在搞 OI(四)
(怎么自动变成两天一更了?) ——因为我菜啊 T_T Day 5 今天上午刷得爽啊!5 道 NOIP,前四题直接 1A,然而最后一题还是 WA 了一发才 A... 第一题是个简单的贪心,题意大概是 n ...
- 自动化运维之puppet的学习(如何找到你需要的模块)
https://forge.puppetlabs.com/ puppet 模块下载 http://kisspuppet.com/2014/01/14/puppet_forge_modules/ pu ...
- ubuntu 桌面版性能调优
http://www.howtogeek.com/115797/6-ways-to-speed-up-ubuntu/
- django-cms 代码研究(三)插件(plugs in)
插件(plugs in) djangocms支持的插件有: http://docs.django-cms.org/en/latest/basic_reference/plugin_reference. ...
- TortoiseSVN中图标的含义
今天在使用svn时发现有好多不认识了,所以查了下svn帮助手册.借此总结了下 svn 中图标的含义 一个新检出的工作复本使用绿色的勾做重载.表示Subversion状态 正常. 在开始编辑一个文件后, ...
- spring3 + mybatis + maven:junit测试错误
org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component c ...
- 【转】js onclick用法:跳转到指定URL
使用onclick跳转到其他页面/跳转到指定url ☆如果是本页显示可以直接用location,方法如下: ①onclick="javascript:window.location.hr ...
- static_cast dynamic_cast const_cast reinterpret_cast总结对比
[本文链接] http://www.cnblogs.com/hellogiser/p/static_cast-dynamic_cast-const_cast-reinterpret_cast.html ...
- 【python】队列
来源:http://www.cnblogs.com/yupeng/p/3413852.html 关于队列 >>> from collections import deque > ...