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="">题目链接 ...
随机推荐
- 通知栏Notification的学习
转:http://blog.csdn.net/yczz/article/details/28416893 在android的应用层中,涉及到很多应用框架,例如:Service框架,Activity管理 ...
- POJ3233Matrix Power Series(十大矩阵问题之三 + 二分+矩阵快速幂)
http://poj.org/problem?id=3233 Matrix Power Series Time Limit: 3000MS Memory Limit: 131072K Total ...
- U盘中的autorun.inf
怎么删除u盘里的autorun.inf 如果U盘中毒,刚插进机子时按住SHIFT五秒,这样就可以跳过预读,这样防止了预读时把病毒感染到机子上,在U盘盘符上点右键,看看有没有“Auto”选项: 1.如果 ...
- 转载大神的检测网站重定向的python脚本
#!/usr/bin/env python #coding=utf8 import sys import requests def check_for_redirects(url): try: r = ...
- mySQL 增量备份方案(转)
1.在 /etc/my.cnf 下面设置开启bin-log 编辑 vim /etc/my.cnf [mysqld] binlog_format = MIXED ...
- Mongodb For C# "Query" 对象常用的方法
Query.All("name", "a", "b");//通过多个元素来匹配数组 Query.In("name", & ...
- Oracle 客户端配置
nstantclient-basic-nt-12.1.0.1.0\instantclient_12_1下面新建NETWORK文件夹,NETWORK下新建ADMIN文件夹,ADMIN下新建tnsname ...
- linux在安装jdk时报错
用脚本执行jdk时下面的错误 can not initialize UI, Running in headless mode, No X11 DISPLAY variable was set, but ...
- oracle数据库备份与还原
一 关于expdp和impdp 使用EXPDP和IMPDP时应该注意的事项:EXP和IMP是客户端工具程序,它们既可以在客户端使用,也可以在服务端使用.EXPDP和IMPDP是服务端的工具程 ...
- The Dragon of Loowater
The Dragon of Loowater Once upon a time, in the Kingdom of Loowater, a minor nuisance turned into ...