HDU 5832A water problem
大数 判断整除
/* ***********************************************
Author :guanjun
Created Time :2016/8/14 19:04:01
File Name :hdu5832.cpp
************************************************ */
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <stdio.h>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <string>
#include <math.h>
#include <stdlib.h>
#include <iomanip>
#include <list>
#include <deque>
#include <stack>
#define ull unsigned long long
#define ll long long
#define mod 90001
#define INF 0x3f3f3f3f
#define maxn 10010
#define cle(a) memset(a,0,sizeof(a))
const ull inf = 1LL << ;
const double eps=1e-;
using namespace std;
priority_queue<int,vector<int>,greater<int> >pq;
struct Node{
int x,y;
};
struct cmp{
bool operator()(Node a,Node b){
if(a.x==b.x) return a.y> b.y;
return a.x>b.x;
}
}; bool cmp(int a,int b){
return a>b;
}
char s[];
int a[];
int main()
{
#ifndef ONLINE_JUDGE
//freopen("in.txt","r",stdin);
#endif
//freopen("out.txt","w",stdout);
int cas=;
while(scanf("%s",&s)!=EOF){
int n=strlen(s);
for(int i=;i<n;i++)a[i]=s[i]-'';
for(int i=;i<n;i++){
a[i]=(a[i-]*+a[i])%;
}
if(a[n-]){
printf("Case #%d: NO\n",++cas);
}
else printf("Case #%d: YES\n",++cas);
}
return ;
}
HDU 5832A water problem的更多相关文章
- HDU 5867 Water problem (模拟)
Water problem 题目链接: http://acm.split.hdu.edu.cn/showproblem.php?pid=5867 Description If the numbers ...
- HDU 5867 Water problem
处理出1-99的,之后的加上多少hundred和and即可.整百和一千的时候注意一下. #pragma comment(linker, "/STACK:1024000000,10240000 ...
- HDU 5867 Water problem ——(模拟,水题)
我发这题只是想说明:有时候确实需要用水题来找找自信的~ 代码如下: #include <stdio.h> #include <algorithm> #include <s ...
- HDU 5832 A water problem(某水题)
p.MsoNormal { margin: 0pt; margin-bottom: .0001pt; text-align: justify; font-family: Calibri; font-s ...
- hdu 5443 The Water Problem
题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=5443 The Water Problem Description In Land waterless, ...
- HDU 5832 A water problem (带坑水题)
A water problem 题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5832 Description Two planets named H ...
- hdu 5443 The Water Problem 线段树
The Water Problem Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.php? ...
- HDU 4974 A simple water problem(贪心)
HDU 4974 A simple water problem pid=4974" target="_blank" style="">题目链接 ...
- HDU 5832 A water problem 水题
A water problem 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5832 Description Two planets named H ...
随机推荐
- PHP项目中配置Apache环境
安装Apache服务器(PHP环境) 首先应该去官网上下载响应的压缩包文件,此时应该注意自己电脑所安装的VC依赖包版本,应该下载对应依赖包的压缩包,且应该根据自己系统的版本选择64或32位压缩包,目前 ...
- thinkphp3.2使用PHPQrcode实现二维码
Thinkphp中没有二维码相关的生成库,百度有不少工具和库 这里就实例一下通过think3.2搭配phpqrcode来完成生成二维码的功能. 至于phpQrcode库文件 百度很容易找到这里也给大家 ...
- 如何自己实现session功能
session字如其意,它的存在就是为了保持会话状态.PHP中的$_SESSION让我们很方便的使用它,但是如果PHP本身不提供这个功能,我们该如何实现呢?且听我慢慢忽悠. session的实现原理 ...
- 选项B中:int b[][3]={0,1,2,3}
选项B中:int b[][3]={0,1,2,3};等价于 int b[][3]={0,1,2,3,0,0}; int b[][3]={0,1,2,3,4}; cout<& ...
- python 去掉html中其他属性,只保留href 和 src
https://segmentfault.com/q/1010000010845573 import re #reg=r'\s+[^(href)]*=\"[^<>]+\" ...
- jsp+servlet+mysql增删改查
用的IntelliJ IDEA开发的,jdk1.8 1 首先是项目结构,如下图所示 2看各层的代码 首先是web.xml <?xml version="1.0" encodi ...
- 7-8 哈利·波特的考试(25 分)(图的最短路径Floyd算法)
7-8 哈利·波特的考试(25 分) 哈利·波特要考试了,他需要你的帮助.这门课学的是用魔咒将一种动物变成另一种动物的本事.例如将猫变成老鼠的魔咒是haha,将老鼠变成鱼的魔咒是hehe等等.反方向变 ...
- CookiesReader
CookiesReader "use strict"; /** * * @author xgqfrms * @license MIT * @copyright xgqfrms * ...
- codeforces 359A
#include<stdio.h> #define N 60 int map[N][N]; int main() { int n,m,i,j,flag; while(scanf(&qu ...
- hihocoder #1034 : 毁灭者问题 平衡树(set)+线段树
#1034 : 毁灭者问题 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 在 Warcraft III 之冰封王座中,毁灭者是不死族打三本后期时的一个魔法飞行单位. 毁 ...