HDU 5867 Water problem
处理出1-99的,之后的加上多少hundred和and即可。整百和一千的时候注意一下。
#pragma comment(linker, "/STACK:1024000000,1024000000")
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<vector>
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<iostream>
using namespace std;
typedef long long LL;
const double pi=acos(-1.0),eps=1e-;
void File()
{
freopen("D:\\in.txt","r",stdin);
freopen("D:\\out.txt","w",stdout);
}
template <class T>
inline void read(T &x)
{
char c = getchar(); x = ;while(!isdigit(c)) c = getchar();
while(isdigit(c)) { x = x * + c - ''; c = getchar(); }
} int a[];
int b[]; int main()
{
b[]=; b[]=; b[]=; b[]=; b[]=;
b[]=; b[]=; b[]=; b[]=; for(int i=;i<=;i++) a[i]=b[i]; a[]=; a[]=; a[]=; a[]=; a[]=;
a[]=; a[]=; a[]=; a[]=; a[]=; a[]=; for(int i=;i<=;i++) a[i]=a[]+b[i-];
a[]=; for(int i=;i<=;i++) a[i]=a[]+b[i-];
a[]=; for(int i=;i<=;i++) a[i]=a[]+b[i-];
a[]=; for(int i=;i<=;i++) a[i]=a[]+b[i-];
a[]=; for(int i=;i<=;i++) a[i]=a[]+b[i-];
a[]=; for(int i=;i<=;i++) a[i]=a[]+b[i-];
a[]=; for(int i=;i<=;i++) a[i]=a[]+b[i-];
a[]=; for(int i=;i<=;i++) a[i]=a[]+b[i-]; int p;
for(int i=;i<=;i++)
{
if(i%==) p=i, a[i]=b[i/]+;
else a[i]=a[p]++a[i-p];
}
a[]=; for(int i=;i<=;i++) a[i]=a[i]+a[i-]; int T; scanf("%d",&T);
while(T--)
{
int n; scanf("%d",&n);
printf("%d\n",a[n]);
}
return ;
}
HDU 5867 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 ——(模拟,水题)
我发这题只是想说明:有时候确实需要用水题来找找自信的~ 代码如下: #include <stdio.h> #include <algorithm> #include <s ...
- HDU 5832A water problem
大数 判断整除 /* *********************************************** Author :guanjun Created Time :2016/8/14 1 ...
- 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 ...
随机推荐
- Python random模块(获取随机数)常用方法和使用例子
random.randomrandom.random()用于生成一个0到1的随机符点数: 0 <= n < 1.0 random.uniformrandom.uniform(a, b),用 ...
- Spark Graphx编程指南
问题导读1.GraphX提供了几种方式从RDD或者磁盘上的顶点和边集合构造图?2.PageRank算法在图中发挥什么作用?3.三角形计数算法的作用是什么?Spark中文手册-编程指南Spark之一个快 ...
- iOS 手势识别
首先给大家解释一下为什么要学习手势识别? 如果想监听一个UIView上面的触摸事件,之前的做法是: 自定义一个UIView : 实现UIView的touches方法,在方法里面实现具体功能 透过tou ...
- Linux sendmail 详解
Internet上最基本的服务,现在应该大部分人都有自己的邮箱吧,用的人多,但理解的人估计没多少,我自己以前也是常常用,但对其原理并不操心.今天就来操心下,进行个小总结 一.邮件服务的基本流程 ...
- <video>和<audio>标签,对视频和音频的支持
H5新增了<video>和<audio>标签,提供对视频和音频的支持 <audio>的属性与<video>属性相同 <video> vide ...
- feature2d相关
1.Harris角点检测 是基于灰度图像的角点检测. 灰度变化率函数如下: 其中的w(x,y)为加权函数,可为常数或为高斯函数.之后对E(u,v)进行泰勒级数的展开与化简,最终得到 ,,Ix,Iy是图 ...
- SQL2008将服务器的数据库表数据插入到本地数据库
一,配置参数 exec sp_configure reconfigure exec sp_configure RECONFIGURE 若不配置参数会出现,提示这个错误: SQL Server 阻止了对 ...
- trove instance service 总结
def create(self, req, body, tenant_id): # TODO(hub-cap): turn this into middleware LOG.info(_LI(&quo ...
- javascript variables 变量
一,调试方法: 1.document.write(); 直接在网页中显示. 2.alert(); 弹窗显示. 3.console. ...
- Playmaker 基础使用与案例操作
首先是把下载好的插件导入Unity工程中. ▼导入完成后第一个动作就是检查下拉菜单里面是否已经增加了Playmaker的功能,如果在安装后没看到Playmaker的菜单,一般情况下直接点击菜单上的空白 ...