HDU5832——A water problem(CCPC网络赛第一题)
来源:互联网 发布:捷易通淘宝助理 编辑:程序博客网 时间:2024/06/05 09:25
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
Total Submission(s): 342 Accepted Submission(s): 187
Problem Description
Two planets named Haha and Xixi in the universe and they were created with the universe beginning.
There is73 days in Xixi a year and 137 days in Haha a year.
Now you know the daysN after Big Bang, you need to answer whether it is the first day in a year about the two planets.
There is
Now you know the days
Input
There are several test cases(about 5 huge test cases).
For each test, we have a line with an only integerN(0≤N) , the length of N is up to 10000000 .
For each test, we have a line with an only integer
Output
For the i-th test case, output Case #i: , then output "YES" or "NO" for the answer.
Sample Input
100010333
Sample Output
Case #1: YESCase #2: YESCase #3: NO
解:大数取模运算,如果同时整除73和137,也就是整除10001。
#include<stdio.h>#include<string.h>char a[10000007]; int main() { int count=1; while(gets(a)){ long long len=0; len = strlen(a); int sum=0; for(long long i=0;i<len;i++){ sum=(sum*10+a[i]-'0')%10001; } if(sum) printf("Case #%d: NO\n",count++); else printf("Case #%d: YES\n",count++); } return 0; }
0 0
- HDU5832——A water problem(CCPC网络赛第一题)
- hdu5832 A water problem
- HDU5832-A water problem
- HDU 5832——A water problem & 2016CCPC网络赛1001
- HDU-5832-A water problem【2016CCPC网络赛】
- hdu5832 A water problem (大数求余)
- hdu5832-ccpc网络赛 -高精度取余
- hdu5832 CCPC 网络赛 同余求模定理
- 2016中国大学生程序设计竞赛 - 网络选拔赛 1001 A water problem hdu5832
- hdu5832-A water problem-续缘之路
- 【2016-CCPC-A】水题(A water problem,hdu 5832)
- CCPC(NQ)2016 - 1001 - A water problem 一个水题
- HDU 5832 A water problem(取模~)—— 2016中国大学生程序设计竞赛 - 网络选拔赛
- hdu 5832 A water problem 2016icpc网络赛
- hdu 5443 The Water Problem(长春网络赛——暴力)
- 14级组队赛第一场3319 A simple water problem
- hdu 4974——A simple water problem
- hdu5443 The Water Problem(长春网络赛)
- ScrollView下,ListView【生存之道】
- hdu题目分类
- POJ3414 Pots
- R语言中的并行计算
- altium designer中布局PCB器件时的翻转问题
- HDU5832——A water problem(CCPC网络赛第一题)
- 前端开发中经常使用到的20个正则表达式(Mark 一下)
- 二叉树的下一个结点
- 身份实名认证返照
- 欢迎使用CSDN-markdown编辑器
- web前端 | 一条“不归路” - 学习路线
- 4道过滤菜鸟的iOS面试题
- nginx 使用
- 特征值分解与主成分分析