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="">题目链接 ...
随机推荐
- Git环境的搭建及使用
管理工具 1. Git环境的搭建 a.下载Git installer,地址:http://git-scm.com/downloads a1.参考文档地址:http://www.open-open.co ...
- 【poj1007】 DNA Sorting
http://poj.org/problem?id=1007 (题目链接) 题意 给出m个字符串,将其按照逆序对个数递增输出. Solution 树状数组经典应用. 代码 // poj1007 #in ...
- (BZOJ4538)HNOI2016 网络
HNOI2016 Day1 T2 网络 Description 一个简单的网络系统可以被描述成一棵无根树.每个节点为一个服务器.连接服务器与服务器的数据线则看做一条树边.两个服务器进行数据的交互时,数 ...
- rockmongo用法
.简单查询 //xid=560870 and type=video { , "type": "video" } //查询数组中的数据 array( " ...
- WPF获取鼠标当前位置
/// <summary> /// 设置鼠标的坐标 /// </summary> /// <param name="x">横坐标</par ...
- 新浪微博客户端(9)-实现版本新特性的ViewPager
"DJNewFeatureViewController.m" #import "DJNewFeatureViewController.h" #define NE ...
- [Angularjs]asp.net mvc+angularjs+web api单页应用
写在前面 最近的工作一直在弄一些h5的单页应用,然后嵌入到app的webview中.之前一直在用angularjs+html+ashx的一套东西.实在是玩腻了.然后就尝试通过asp.net mvc的方 ...
- 【分享】4款WiFi广告营销利器推荐
随着WiFi的普及,相信大家已经发现很多公共场合连接WiFi的时候会要求登录,这个就是所谓的WiFi广告了. 什么是WiFi广告呢?(以下引用百科) WiFi广告是目前WiFi营销的主要方 ...
- 微信用户量破6.5亿 首超移动QQ
腾讯控股有限公司昨日公布了微信和WeChat合并月活跃用户量达到6.5亿,同比再涨39%.QQ在移动智能终端月活为6.39亿,同比增长18%,尽管势头也不错,但这是第一次,微信干掉了移动QQ! 201 ...
- cocos基础教程(10)纹理缓存技术
Cocos2d通过调用CCTextureCache或者CCSpriteFrameCache来缓存精灵的纹理. 当这个精灵调用CCTextureCache 或 CCSpriteFrameCache的方法 ...