CCPC网赛,HDU_5832 A water problem
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.
"YES" or "NO" for the answer.
#include<cstdio>
#include<cstring>
#define N 10000001
char s[N];
int main()
{
long long mod;
int len;
int n=;
int kk=;
while(scanf("%s",s)!=EOF)
{
len=strlen(s);
mod=;
for(int i=; i<len; i++)
{
mod=mod*+s[i]-'';
mod=mod%n;
}
if(mod==){
printf("Case #%d: YES\n",kk);
}else{
printf("Case #%d: NO\n",kk);
}
kk++;
} return ;
}
题目大意:
一个星星一年73天,一个星星一年137天。给你一个天数,问两者是不是恰好都是第一天。
思路解析:
这题思路并不难想,就是求对73*173=10001取余是不是为0。这道题的坑就在大数的计算上。大数的取余计算,直接套模板。
(P.S:= =好累啊 下午5个小时 感觉身体被掏空。更一道下午的题算了,睡了睡了233333。)
CCPC网赛,HDU_5832 A water problem的更多相关文章
- ccpc网赛 hdu6703 array(权值线段树
http://acm.hdu.edu.cn/showproblem.php?pid=6703 大意:给一个n个元素的数组,其中所有元素都是不重复的[1,n]. 两种操作: 将pos位置元素+1e7 查 ...
- ccpc网赛 hdu6705 path(队列模拟 贪心
http://acm.hdu.edu.cn/showproblem.php?pid=6705 这是比赛前8题过的人数第二少的题,于是就来补了,但感觉并不难啊..(怕不是签到难度 题意:给个图,给几条路 ...
- hdu 5443 The Water Problem(长春网络赛——暴力)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5443 The Water Problem Time Limit: 1500/1000 MS (Java ...
- Big Water Problem
链接:https://www.nowcoder.com/acm/contest/77/B来源:牛客网 Big Water Problem 时间限制:C/C++ 1秒,其他语言2秒 空间限制:C/C++ ...
- 2018 ACMICPC上海大都会赛重现赛 H - A Simple Problem with Integers (线段树,循环节)
2018 ACM 国际大学生程序设计竞赛上海大都会赛重现赛 H - A Simple Problem with Integers (线段树,循环节) 链接:https://ac.nowcoder.co ...
- HDU 5832 A water problem(某水题)
p.MsoNormal { margin: 0pt; margin-bottom: .0001pt; text-align: justify; font-family: Calibri; font-s ...
- hdu5832 A water problem
A water problem Time Limit: 5000/2500 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)T ...
- hdu 5443 The Water Problem
题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=5443 The Water Problem Description In Land waterless, ...
- [CCPC2016]网赛部分比赛代码
来自HDOJ: 5833 ( Zhu and 772002 ) /* ━━━━━┒ギリギリ♂ eye! ┓┏┓┏┓┃キリキリ♂ mind! ┛┗┛┗┛┃\○/ ┓┏┓┏┓┃ / ┛┗┛┗┛┃ノ) ┓┏ ...
随机推荐
- PHP字符串操作常用函数
/* * 确定字符串长度 * int strlen(string str) * 比较两个字符串 * 1.strcmp函数对两个字符串进行二进制安全的比较,并区分大小写 * int strcmp(str ...
- Esper系列(七)数据缓存、外部事件应用(静态方法)
LRU Cache 功能:最近最少使用策略. 数据库查询缓存应用配置: 1 ); 12 } 13 return bean; 14 } 15 } ...
- Zookeeper集群安装详解
Zookeeper的角色 Zookeeper集群搭建 要求:服务器集群规模不小于3个节点,各服务器之间系统时间要保持一致! 安装步骤 1.在h1节点解压,目录改名. tar –zxvf zooke ...
- [Git]git常用命令总结
git clone url 将远程库复制到本地 git status 查看本地库的状态 git add filename.filetype 将库中被修改的文件标记为添加状态 git diff 查看库中 ...
- webpack文档
https://github.com/liunian/webpack-doc/blob/master/SUMMARY.md
- DevExpress GridControl GridView 导出到 Excel 类
说明: 1>GridView 导出到 Excel (如果分页,只导出当前页数据) 2>GridView 导出到 Excel 3>方法2可以参考DataTable 导出到 Excel ...
- 剖析iphone之触摸事件touchstart
今天做项目发现一个问题,貌似从前没有遇到过,就记录一下,以后方便看.....(代码只显示了js这部分 样式结构都会写) 一般我们绑定click触发事件都是直接用onclick 或者方便一点click, ...
- Spring mvc Interceptor 解决Session超时配置流程
最近公司内部框架中对Session超时这一功能未实现,由于采用iframe结构,Session超时后,当点击左侧系统菜单时,会在iframe的右侧再次弹出登陆框. 该问题是由于没有设置拦截器造成. 添 ...
- 【Servlet】Filter过滤器的编写和配置
Servlet的Filter介绍 在Servlet作为过滤器使用时,它可以对客户的请求进行过滤处理,当它处理完成后,它会交给下一个过滤器处理,就这样,客户的请求在过滤链里一个个处理,直到请求发送到目标 ...
- 关于模拟器不能运行项目问题:Installation error: INSTALL_FAILED_INSUFFICIENT_STORAGE
我有一个习惯,当做完某一项功能时就想试试运行效果.所以一个程序完成前会运行无数遍.但是有时会出现不能运行的问题,并且这个问题不是来自项目的错误,显示器显示如下错误: [2013-08-31 08:45 ...