Problem 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
代码如下:
 #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的更多相关文章

  1. ccpc网赛 hdu6703 array(权值线段树

    http://acm.hdu.edu.cn/showproblem.php?pid=6703 大意:给一个n个元素的数组,其中所有元素都是不重复的[1,n]. 两种操作: 将pos位置元素+1e7 查 ...

  2. ccpc网赛 hdu6705 path(队列模拟 贪心

    http://acm.hdu.edu.cn/showproblem.php?pid=6705 这是比赛前8题过的人数第二少的题,于是就来补了,但感觉并不难啊..(怕不是签到难度 题意:给个图,给几条路 ...

  3. hdu 5443 The Water Problem(长春网络赛——暴力)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5443 The Water Problem Time Limit: 1500/1000 MS (Java ...

  4. Big Water Problem

    链接:https://www.nowcoder.com/acm/contest/77/B来源:牛客网 Big Water Problem 时间限制:C/C++ 1秒,其他语言2秒 空间限制:C/C++ ...

  5. 2018 ACMICPC上海大都会赛重现赛 H - A Simple Problem with Integers (线段树,循环节)

    2018 ACM 国际大学生程序设计竞赛上海大都会赛重现赛 H - A Simple Problem with Integers (线段树,循环节) 链接:https://ac.nowcoder.co ...

  6. HDU 5832 A water problem(某水题)

    p.MsoNormal { margin: 0pt; margin-bottom: .0001pt; text-align: justify; font-family: Calibri; font-s ...

  7. hdu5832 A water problem

    A water problem Time Limit: 5000/2500 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)T ...

  8. hdu 5443 The Water Problem

    题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=5443 The Water Problem Description In Land waterless, ...

  9. [CCPC2016]网赛部分比赛代码

    来自HDOJ: 5833 ( Zhu and 772002 ) /* ━━━━━┒ギリギリ♂ eye! ┓┏┓┏┓┃キリキリ♂ mind! ┛┗┛┗┛┃\○/ ┓┏┓┏┓┃ / ┛┗┛┗┛┃ノ) ┓┏ ...

随机推荐

  1. POJ-3207 Ikki's Story IV - Panda's Trick 2sat

    题目链接:http://poj.org/problem?id=3207 题意:在一个圆圈上有n个点,现在用线把点两两连接起来,线只能在圈外或者圈内,现给出m个限制,第 i 个点和第 j 个点必须链接在 ...

  2. tool

    数据结构,堆栈基本原理; 数组,堆栈,结构体等系列,数据结构间区别联系; 在此我就不饶了,直接上大白话(我总认为干些实事,比扯淡强....),故事虚构,若有雷同,请你下方留言; ruiy讲的,所跑的托 ...

  3. 问题-delphi XE2 Stack Overflow- save your work and restart CodeGear

    问题现象:某一天,启动DLEPHI XE2 后,新建一个工程,双击一个事件,“Stack Overflow- save your work and restart CodeGear delphi xe ...

  4. 新发现:原来java正则表达式不写^和$也可以运行

    最近用了好多正则表达式,都是循规蹈矩的在前面加上^在后面加上$ 像这个样子"^[.]\\S+$",但实际上我在eclipse和editplus下都试了一下,不加前缀和后缀也是可以的 ...

  5. linux下利用openssl来实现证书的颁发(详细步骤)--转载和修改

    原文地址:http://www.cnblogs.com/firtree/p/4028354.html linux下利用openssl来实现证书的颁发(详细步骤) 1.首先需要安装openssl,一个开 ...

  6. 安装、配置JDK的步骤

    1.配置环境变量,打开我的电脑--属性--高级--环境变量,新建系统变量JAVA_HOME .变量值:jdk的目录,比如d:/java.选择“系统变量”中变量名为“Path”的环境变量双击该变量,把J ...

  7. NLog使用说明

    NLog是一个基于.NET平台编写的类库,我们可以使用NLog在应用程序中添加极为完善的跟踪调试代码. NLog允许我们自定义从跟踪消息的来源(source)到记录跟踪信息的目标(target)的规则 ...

  8. 兰亭集势笔试题:用最优方法从LinkedList列表中删除重复元素

    用运行速度最优的方法从LinkedList列表里删除重复的元素,例如A->B->BB->B->C,返回A->B->BB->C. 考试的时候没完全想明白,考完又 ...

  9. play wav sound

    播放 WAV文件             string s = @"D:\Administrator\安装文件\完美世界国际版\patcher\skin\sounds\click.wav&q ...

  10. DELPHI TDownLoadURL下载网络文件

      DELPHI XE6 FMX 附件:http://files.cnblogs.com/xe2011/IDHttp_fmx.7z unit Unit1; interface uses //引用 Vc ...