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 ...
随机推荐
- [Python3网络爬虫开发实战] 1.2.3-ChromeDriver的安装
前面我们成功安装好了Selenium库,但是它是一个自动化测试工具,需要浏览器来配合使用,本节中我们就介绍一下Chrome浏览器及ChromeDriver驱动的配置. 首先,下载Chrome浏览器,方 ...
- canvas学习--准备
一)canvas标签 属性: 1.width 和 height 控制canvas宽高: 2.style添加基本样式 3.class,id属性 4.标签内添加一行文本,主要用于浏览器不支持canvas标 ...
- django+uwsgi+nginx部署(非常详细)
django+uwsgi+nginx部署 1.介绍: 在网上看了很多教程,但自己部署了很久都没有成功,这篇博文记录自己所踩过得坑. 2.环境: Ubuntu 16.04.1 LTS (GNU/Linu ...
- hihocoder 1515 分数调查(树形dp)
hihocoder 1515 分数调查 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 小Hi的学校总共有N名学生,编号1-N.学校刚刚进行了一场全校的古诗文水平测验. ...
- jmap Unable to open socket file解决
pid:Unable to open socket file: target process not responding or HotSport VM not loadedThe -F option ...
- fmt:formatDate的输出格式详解
<fmt:formatDate value="${isoDate}" type="both"/> 2004-5-31 23:59:59 <fm ...
- 全文索引(A-1)-用户数据收集(用户研究)
推荐系统根据用户的信息和历史行为记录,构造出用户的个性化模型,再依据特定的推荐算法,向用户推荐其可能感兴趣的项目. 如何获取用户的偏好? 建议用户对一些指定项目进行评分,如对:小说.传记.技术书.图画 ...
- css3 & background & background-image
css3 & background & background-image https://developer.mozilla.org/en-US/docs/Web/CSS/backgr ...
- HDU 2280 状压DP
用dfs找到状态的最优解 且那个正方形块可以由两个水平块组成,所以无需考虑 #include <cstdio> #include <cstring> #include < ...
- ZOJ 3329 期望DP
题目大意: 给定3个已经规定好k1,k2,k3面的3个色子,如果扔到a,b,c则重新开始从1 计数,否则不断叠加所有面的数字之和,直到超过n,输出丢的次数的数学期望 我们在此令dp[]数组记录从当前数 ...