题意:给定一个大数,问你取模73 和 137是不是都是0.

析:没什么可说的,先用char 存储下来,再一位一位的算就好了。

代码如下:

  1. #pragma comment(linker, "/STACK:1024000000,1024000000")
  2. #include <cstdio>
  3. #include <string>
  4. #include <cstdlib>
  5. #include <cmath>
  6. #include <iostream>
  7. #include <cstring>
  8. #include <set>
  9. #include <queue>
  10. #include <algorithm>
  11. #include <vector>
  12. #include <map>
  13. #include <cctype>
  14. #include <stack>
  15. using namespace std;
  16.  
  17. typedef long long LL;
  18. typedef pair<int, int> P;
  19. const int INF = 0x3f3f3f3f;
  20. const double inf = 0x3f3f3f3f3f3f;
  21. const LL LNF = 100000000000000000;
  22. const double PI = acos(-1.0);
  23. const double eps = 1e-8;
  24. const int maxn = 1e7 + 5;
  25. const int mod = 1e9 + 7;
  26. const char *mark = "+-*";
  27. const int dr[] = {-1, 0, 1, 0};
  28. const int dc[] = {0, 1, 0, -1};
  29. int n, m;
  30. inline bool is_in(int r, int c){
  31. return r >= 0 && r < n && c >= 0 && c < m;
  32. }
  33. inline LL Max(LL a, LL b){ return a < b ? b : a; }
  34. inline LL Min(LL a, LL b){ return a > b ? b : a; }
  35. char s[maxn];
  36.  
  37. int main(){
  38. int kase = 0;
  39. while(scanf("%s", s) == 1){
  40. int ans1 = 0, ans2 = 0;
  41. n = strlen(s);
  42. for(int i = 0; i < n; ++i){
  43. ans1 = (ans1 * 10 + s[i] - '0') % 73;
  44. ans2 = (ans2 * 10 + s[i] - '0') % 137;
  45. }
  46.  
  47. printf("Case #%d: %s\n", ++kase, !ans1 && !ans2 ? "YES" : "NO");
  48. }
  49. return 0;
  50. }

  

HDU 5832 A water problem (水题,大数)的更多相关文章

  1. HDU 5832 A water problem 水题

    A water problem 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5832 Description Two planets named H ...

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

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

  3. HDU 5832 A water problem (带坑水题)

    A water problem 题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5832 Description Two planets named H ...

  4. hdu-5867 Water problem(水题)

    题目链接: Water problem Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Othe ...

  5. HDU 5832 A water problem

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

  6. HDU 5538 L - House Building 水题

    L - House Building Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.ph ...

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

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

  8. hdu 1005:Number Sequence(水题)

    Number Sequence Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)T ...

  9. hdu 1018:Big Number(水题)

    Big Number Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total ...

随机推荐

  1. Codeforces Round #232 (Div. 2) B. On Corruption and Numbers

    题目:http://codeforces.com/contest/397/problem/B 题意:给一个n ,求能不能在[l, r]的区间内的数字相加得到, 数字可多次重复.. 比赛的时候没有想出来 ...

  2. ACM - ICPC World Finals 2013 C Surely You Congest

    原题下载:http://icpc.baylor.edu/download/worldfinals/problems/icpc2013.pdf 题目翻译: 试题来源 ACM/ICPC World Fin ...

  3. iOS应用的crash日志的分析基础

        Outline如何获得crash日志如何解析crash日志如何分析crash日志     1. iOS策略相关     2. 常见错误标识     3. 代码bug 一.如何获得crash日志 ...

  4. H.264学习笔记之一(层次结构,NAL,SPS)

    一 H.264句法 1.1元素分层结构 H.264编码器输出的Bit流中,每个Bit都隶属于某个句法元素.句法元素被组织成有层次的结构,分别描述各个层次的信息. 图1 H.264分层结构由五层组成,分 ...

  5. Android 快速开发框架XUtils

    转载自:http://www.apkbus.com/forum.php?mod=viewthread&tid=241060&highlight=xUtils 最近搜了一些框架供初学者学 ...

  6. SQL 2005 日志损坏的恢复方法

    SQL 在突然停电或者非正常关机下,可能会出现日期文件错误,导致数据库不正常.恢复数据库方法如下 1.数据库服务停掉 将数据库文件备份 例如数据库名为 DTMS 则将 DTMS.mdf 备份出来. 2 ...

  7. UVA 10054 The Necklace

    完全就是哭瞎的节奏···QAQ 又是图论··· 题意:有一种项链,每个珠子上有两种颜色,相同颜色的两颗珠子的两头相连,如果能连成环输出珠子的顺序,不能连成环输出"some beads may ...

  8. Python--类使用

    类使用的几个注意点: 1. 类的语法结构:2. __init__(self),3. __metaclass__=type, (新式类)4. super(subclassname, self).__in ...

  9. 【Linux学习】 写一个简单的Makefile编译源码获取当前系统时间

    打算学习一下Linux,这两天先看了一下gcc的简单用法以及makefile的写法,今天是周末,天气闷热超市,早晨突然发现住处的冰箱可以用了,于是先出去吃了点东西,然后去超市买了一坨冰棍,老冰棍居多, ...

  10. Winxp下搭建SVN服务器

    本文介绍一种在winxp下搭建SVN服务器的方法. (1) 需要下载Slik-Subversion和TortoiseSVN两个软件.我使用的版本是Slik-Subversion-1.8.3-1-win ...