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 ...
随机推荐
- 常量指针(pointer to constant)和指针常量(constant pointer)
一个指针可以操作两个实体,一个是指针值(即地址),一个是间访值(即指向的实体).于是指针的常量性也分为两种:常量指针(pointer to constant)和指针常量(constant pointe ...
- java配置日志总结
log4j 搭建日志环境 简单非maven项目,只需要引入log4j.jar,在类路径下添加log4j.properties即可 简单maven项目,只需要在pom.xml引入dependency,在 ...
- 去掉idea中的警告
目前我使用的两种方法 1.idea右下角有个小人,单击后选择Syntax即可 2.在setting→Editor→Inspections搜索SQL,把No data sources configure ...
- pxc集群安装
一.pxc镜像url:https://hub.docker.com/r/percona/percona-xtradb-cluster/ 二.安装及重命名: 1.安装:docker pull perco ...
- python while、continue、break
while循环实现用户登录 _user = "tom" _passwd = "abc123" counter = 0 while counter < 3: ...
- python 博客开发之散乱笔记
博客开发之旅: # 回滚,数据存储失败时,还原修改操作 from django.db import transaction with transaction.atomic(): do... ... # ...
- I - DFS(依然是漫水填充)
Description There is a rectangular room, covered with square tiles. Each tile is colored either red ...
- 利用mysql分析小规模数据
1 获取数据 示例:(/home/work/data/1.data) 123457,chenli,70 123458,liuyang,71 2 create table CREATE TABLE sc ...
- hdu - 1429 胜利大逃亡(续) (bfs状态压缩)
http://acm.hdu.edu.cn/showproblem.php?pid=1429 终于开始能够做状态压缩的题了,虽然这只是状态压缩里面一道很简单的题. 状态压缩就是用二进制的思想来表示状态 ...
- 百度UEditor富文本上传图片
项目中使用UEditor发现设置图片自定义保存路径会出现<请求后台配置项http错误,上传功能将不能正常使用!错误> /* 上传图片配置项 */ "imageActionName ...