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 ...
随机推荐
- 【面试题015】链表中倒数第k个结点
[面试题015]链表中倒数第k个结点 可以用两个指针,当第一个指针指向了第k个时候,第二个指针让他指向链表的第一个元素,然后这两个指针同时向后面移动, 当第一个指针移动到末尾的时候,第二个指针指 ...
- SSH Tunneling Explained
转载: http://chamibuddhika.wordpress.com/2012/03/21/ssh-tunnelling-explained/ March 21, 2012 by Buddhi ...
- ZOJ 2724 Windows Message Queue (优先级队列,水题,自己动手写了个最小堆)
#include <iostream> #include <stdio.h> #include <string.h> #include <algorithm& ...
- hdu2010
//很闲,刷水..... http://acm.hdu.edu.cn/showproblem.php?pid=2010 #include<iostream> #include<std ...
- [转]Win7下Eclipse中文字体太小
最近新装了Win7,打开eclipse3.7中文字体很小,简直难以辨认.在网上搜索发现这是由于Eclipse 3.7 用的字体是 Consolas,显示中文的时候默认太小了. 解决方式有两种:一. ...
- 【PHPsocket编程专题(实战篇①)】php-socket通信演示
建立Socket连接至少需要一对套接字,其中一个运行于客户端,称为ClientSocket ,另一个运行于服务器端,称为ServerSocket . 套接字之间的连接过程分为三个步骤:服务器监听,客户 ...
- MySQL错误代码大全【转载】
B.1. 服务器错误代码和消息 服务器错误信息来自下述源文件: 错误消息信息列在share/errmsg.txt文件中."%d"和"%s"分别代表编号和字符串, ...
- C语言文件操作函数
C语言文件操作函数大全 clearerr(清除文件流的错误旗标) 相关函数 feof表头文件 #include<stdio.h> 定义函数 void clearerr(FILE * str ...
- iOS 开发-- Runtime 1小时入门教程
1小时让你知道什么是Objective-C Runtime,并对它有一定的基本了解,可以在开发过程中运用自如. 三.Objective-C Runtime到底是什么东西? 简而言之,Objective ...
- React测试Mixin
1.test.jsx var randomNumberMixin = require("./randomNumberMixin.jsx"); describe("test ...