HDU 5832 A water problem 水题
A water problem
题目连接:
http://acm.hdu.edu.cn/showproblem.php?pid=5832
Description
Two planets named Haha and Xixi in the universe and 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.
Input
There are several test cases(about 5 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.
Output
For the i-th test case, output Case #i: , then output "YES" or "NO" for the answer.
Sample Input
10001
0
333
Sample Output
Case #1: YES
Case #2: YES
Case #3: NO
Hint
题意
给你一个数,问你这个数是否能够整除137和73
题解:
这两个数互质,其实就是问你能否整除10001
这个直接扫一遍就好了。
用string可能会TLE,所以老老实实用char就好了
代码
#include<bits/stdc++.h>
using namespace std;
char s[10000005];
int cas = 0;
int main(){
while(scanf("%s",s)!=EOF){
int mod1 = 0;int len=strlen(s);
for(int i=0;i<len;i++){
mod1=(mod1*10+s[i]-'0')%10001;
}
if(mod1==0)printf("Case #%d: YES\n",++cas);
else printf("Case #%d: NO\n",++cas);
}
}
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-5867 Water problem(水题)
题目链接: Water problem Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Othe ...
- 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 (水题,大数)
题意:给定一个大数,问你取模73 和 137是不是都是0. 析:没什么可说的,先用char 存储下来,再一位一位的算就好了. 代码如下: #pragma comment(linker, "/ ...
- HDU 5538 L - House Building 水题
L - House Building Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.ph ...
- hdu 5443 The Water Problem(长春网络赛——暴力)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5443 The Water Problem Time Limit: 1500/1000 MS (Java ...
- hdu 1005:Number Sequence(水题)
Number Sequence Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)T ...
- hdu 1018:Big Number(水题)
Big Number Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total ...
随机推荐
- dedecms列表页调用文章正文内容的方法
谁说dede:list 标签不能调用body内容,现在就告诉你,直接就可以调用 第一步,打开后台 核心-->频道模型-->内容模型管理-->普通文章,在列表附加字段中添加body. ...
- java学习第05天(数组常见操作、数组中的数组)
(4)数组常见操作 a.遍历取值 class ArrayDemo3 { public static void main(String[] args) { //System.out.println(&q ...
- opacity设定图片透明度
实例 1 - 创建透明图像 定义透明效果的 CSS3 属性是 opacity. 首先,我们将展示如何通过 CSS 来创建透明图像. 常规图像: 带有透明度的相同图像: 请看下面的 CSS: img { ...
- 关于mysql-connector-java(JDBC驱动)的一些坑
最近在写一个项目的时候,用了maven仓库里面较新的mysql的JDBC驱动,版本是6.0.6,Mybatis的全局配置是这么写的: <?xml version='1.0' encoding=' ...
- ffmpeg查看音频文件信息
查看音频文件的信息(基于本地路径) import subprocess import json path = r'D:\learn\download\NosVJ60QCIs0b8PVHMPomZJsr ...
- golang container heap&sort
go语言也自己的容器数据结构.主要有list.heap和ring package main import ( "container/heap" "fmt" &q ...
- 总结WCF开发中遇到的几个问题
最近的项目,需要用到WCF,在以前的工作中,经常是将WCF托管在IIS中,主要有几下几个原因: 第一:部署非常方便,和部署一个站点没什么区别: 第二:不受防火墙的影响,因为一般服务 ...
- 一个无锁消息队列引发的血案(六)——RingQueue(中) 休眠的艺术 [续]
目录 (一)起因 (二)混合自旋锁 (三)q3.h 与 RingBuffer (四)RingQueue(上) 自旋锁 (五)RingQueue(中) 休眠的艺术 (六)RingQueue(中) 休眠的 ...
- IIS7配置HTTPS+默认访问https路径
一.下载证书(这里我使用的是阿里云免费的证书) 文件说明: 1. 1532858285913.key(证书私钥文件).1532858285913.pem(证书文件).1532858285913.pfx ...
- VC++一些开发心得与调试技巧
1.如何在Release状态下进行调试 Project->Setting=>ProjectSetting对话框,选择Release状态.C/C++标签中的Category选Gen ...