HDU 5832 A water problem
A water problem
Time Limit: 5000/2500 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)
Total Submission(s): 595 Accepted Submission(s): 308
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.
For each test, we have a line with an only integer N(0≤N), the length of N is up to 10000000.
0
333
#include <cstdio> const int MAXN = 10000000+5;
char s[MAXN]; int main()
{
int cn = 0;
while(~scanf("%s", s)){
int mod = 0;
for(int i = 0; s[i] != '\0'; ++i){
mod = (mod*10+s[i]-'0')%10001;
}
if(mod == 0)
printf("Case #%d: YES\n", ++cn);
else
printf("Case #%d: NO\n", ++cn);
}
return 0;
}
HDU 5832 A water problem的更多相关文章
- HDU 5832 A water problem(某水题)
p.MsoNormal { margin: 0pt; margin-bottom: .0001pt; text-align: justify; font-family: Calibri; font-s ...
- HDU 5832 A water problem (带坑水题)
A water problem 题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5832 Description Two planets named H ...
- HDU 5832 A water problem 水题
A water problem 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5832 Description Two planets named H ...
- HDU 5832 A water problem (水题,大数)
题意:给定一个大数,问你取模73 和 137是不是都是0. 析:没什么可说的,先用char 存储下来,再一位一位的算就好了. 代码如下: #pragma comment(linker, "/ ...
- hdu 5443 The Water Problem
题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=5443 The Water Problem Description In Land waterless, ...
- hdu 5443 The Water Problem 线段树
The Water Problem Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.php? ...
- hdu 5443 The Water Problem(长春网络赛——暴力)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5443 The Water Problem Time Limit: 1500/1000 MS (Java ...
- HDU 5443 The Water Problem (ST算法)
题目链接:HDU 5443 Problem Description In Land waterless, water is a very limited resource. People always ...
- ACM学习历程—HDU 5443 The Water Problem(RMQ)(2015长春网赛1007题)
Problem Description In Land waterless, water is a very limited resource. People always fight for the ...
随机推荐
- How does database indexing work?
When data is stored on disk based storage devices, it is stored as blocks of data. These blocks are ...
- POJ 1906
#include <iostream> #include <string> #define MAXN 150 using namespace std; int _m[MAXN] ...
- 深入浅出ES6(七):箭头函数 Arrow Functions
作者 Jason Orendorff github主页 https://github.com/jorendorff 箭头符号在JavaScript诞生时就已经存在,当初第一个JavaScript教 ...
- 简单易懂的现代魔法——Play Framework攻略4
接前文:简单易懂的现代魔法——Play Framework攻略3 1.The Object 时隔2个多月,Play Framework系列又更新了,本次的主题是:利用Play Framework实现R ...
- 分享一个安装PE到硬盘的软件
Ton8pe_v5.0下载地址:http://pan.baidu.com/share/link?shareid=424350&uk=4180312589 电脑是XP,有光驱,但是没win8.1 ...
- java:IO-读写大文件
import java.io.*; class Test { public static void main(String args[]){ FileInputStream fin =null; Fi ...
- SQL查询(笔记2——实体查询)
SQL查询(笔记2——实体查询) 二.实体查询 如果查询返回了某个数据表的全部数据列,且该数据表有对应的持久化类映射,我们就把查询结果转换成实体查询.将查询结果转换成实体,可以使用SQLQuery提供 ...
- Django admin的一些有用定制
Model实例,myapp/models.py: from django.db import models class Blog(models.Model): name = models.CharFi ...
- HTML基础和表格
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="C ...
- AsciiDoc Markup Syntax Summary
AsciiDoc Markup Syntax Summary ============================== A summary of the most commonly used ma ...