hdu5832 A water problem
A water problem
Time Limit: 5000/2500 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)
Total Submission(s): 342 Accepted Submission(s):
187
they were created with the universe beginning.
There is 73
days in Xixi a year and 137
days in Haha a year.
Now you know the days N
after Big Bang, you need to answer whether it is the first day in a year about
the two planets.
huge test cases).
For each test, we have a line with an only integer
N(0≤N)
, the length of N
is up to 10000000
.
"YES" or "NO" for the answer.
0
333
Case #2: YES
Case #3: NO
#include <iostream>
#include <cstdio>
#include <cstring> using namespace std; char s[]; int main()
{
int z=;
int ans=;
int d=;
int len;
while(scanf("%s",s)!=EOF){
ans=;
len=strlen(s);
for(int i=;i<len;i++){
ans=((ans*+(s[i]-''))%d)%d;
}
if(ans==){
printf("Case #%d: YES\n",z++);
}else{
printf("Case #%d: NO\n",z++);
}
}
return ;
}
hdu5832 A water problem的更多相关文章
- HDU 5832 A water problem(某水题)
p.MsoNormal { margin: 0pt; margin-bottom: .0001pt; text-align: justify; font-family: Calibri; font-s ...
- hdu 5443 The Water Problem
题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=5443 The Water Problem Description In Land waterless, ...
- HDU 5867 Water problem (模拟)
Water problem 题目链接: http://acm.split.hdu.edu.cn/showproblem.php?pid=5867 Description If the numbers ...
- HDU 5832 A water problem
A water problem Time Limit: 5000/2500 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)T ...
- HDU 5832 A water problem (带坑水题)
A water problem 题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5832 Description Two planets named H ...
- hdu 5443 The Water Problem 线段树
The Water Problem Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.php? ...
- HDU-4974 A simple water problem
http://acm.hdu.edu.cn/showproblem.php?pid=4974 话说是签到题,我也不懂什么是签到题. A simple water problem Time Limit: ...
- The Water Problem(排序)
The Water Problem Time Limit: 1500/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Othe ...
- HDU 4974 A simple water problem(贪心)
HDU 4974 A simple water problem pid=4974" target="_blank" style="">题目链接 ...
随机推荐
- 如何使用lessc编译.less文件
LESS :一种动态样式语言. LESS 将 CSS 赋予了动态语言的特性,如 变量, 继承, 运算, 函数. LESS 既可以在 客户端 上运行 (支持IE 6+, Webkit, Firefox) ...
- CODEVS1995 || TYVJ1863 黑魔法师之门
P1863 [Poetize I]黑魔法师之门 时间: 1000ms / 空间: 131072KiB / Java类名: Main 背景 经过了16个工作日的紧张忙碌,未来的人类终于收集到了足够的能源 ...
- openSSL命令、PKI、CA、SSL证书原理
相关学习资料 http://baike.baidu.com/view/7615.htm?fr=aladdin http://www.ibm.com/developerworks/cn/security ...
- php抓取页面的几种方式
在做一些天气预报或者RSS订阅的程序时,往往 需要抓取非本地文件,一般情况下都是利用php模拟浏览器的访问,通过http请求访问url地址, 然后得到html源代码或者xml数据,得到数据我们不能直接 ...
- 学习 easyui 之一:easyloader 分析与使用
http://www.cnblogs.com/haogj/archive/2013/04/22/3036685.html 使用脚本库总要加载一大堆的样式表和脚本文件,在 easyui 中,除了可以使用 ...
- Matlab中的括号()[]{}
Matlab中的括号()[]{} Matlab中经常会用到括号去引用某Array或者是cell的内容,但三者有什么具体区别呢?[ ] 中括号用来构建向量(Vectors)或者是矩阵(Matrices) ...
- iOS Application Life Cycle 应用程序生命周期
应用程序的状态 IOS的应用程序一共有5种状态. Not running(未运行):程序未启动 Inactive(未激活):其他两个状态切换时出现的短暂状态.唯一在此状态停留时间比较长的情况是:当用户 ...
- RHEL6.4记录一次添加一块新分区的操作
首先看了下挂载点及目录 fdisk /dev/sda [root@box ~]# fdisk /dev/sda WARNING: DOS-compatible mode is deprecated. ...
- 将DataTable导出为Excel C#
/// <summary> /// 导出Excel /// </summary> /// <param name="dt">DataTable& ...
- Android Bitmap 全面解析(四)图片处理效果对比 ...
对比对象: UIL Volley 官方教程中的方法(此系列教程一里介绍的,ImageLoader的处理方法和官方的差不多) -------------------------------------- ...