HDU 5867 Water problem ——(模拟,水题)
我发这题只是想说明:有时候确实需要用水题来找找自信的~
代码如下:
#include <stdio.h>
#include <algorithm>
#include <string.h>
using namespace std;
typedef long long ll; int num[+] = {,,,,,,,,,,,,,,,,,,,,};
int sum[+]; void init()
{
for(int i=;i<=;i++) num[i] = + num[i-];
num[] = ;
for(int i=;i<=;i++) num[i] = + num[i-];
num[] = ;num[] = ;num[] = ;num[] = ;num[] = ;num[] = ;
for(int i = ;i<=;i++)
{
if(i%==) continue;
else num[i] = num[i-i%] + num[i%];
}
num[] = ;
for(int i=;i<=;i++)
{
if(i%==)
{
num[i] = num[i/] + ;
}
else
{
num[i] = ;
num[i] += num[i-i%] + num[i%];
}
}
num[] = ;
for(int i=;i<=;i++) sum[i] = sum[i-] + num[i];
} int main()
{
init();
int T;scanf("%d",&T);
while(T--)
{
int n;scanf("%d",&n);
printf("%d\n",sum[n]);
}
}
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 5443 The Water Problem (水题,暴力)
题意:给定 n 个数,然后有 q 个询问,问你每个区间的最大值. 析:数据很小,直接暴力即可,不会超时,也可以用RMQ算法. 代码如下: #include <cstdio> #includ ...
- HDU 5832 A water problem (水题,大数)
题意:给定一个大数,问你取模73 和 137是不是都是0. 析:没什么可说的,先用char 存储下来,再一位一位的算就好了. 代码如下: #pragma comment(linker, "/ ...
- zzulioj--1634--Happy Thanksgiving Day - A + B Problem(模拟水题)
1634: Happy Thanksgiving Day - A + B Problem Time Limit: 1 Sec Memory Limit: 128 MB Submit: 136 ...
- HDU 5867 Water problem
处理出1-99的,之后的加上多少hundred和and即可.整百和一千的时候注意一下. #pragma comment(linker, "/STACK:1024000000,10240000 ...
- HDOJ 2317. Nasty Hacks 模拟水题
Nasty Hacks Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Tota ...
- fzuoj Problem 2182 水题
http://acm.fzu.edu.cn/problem.php?pid=2182 Problem 2182 水题 Accept: 188 Submit: 277Time Limit: 100 ...
- POJ 2014:Flow Layout 模拟水题
Flow Layout Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 3091 Accepted: 2148 Descr ...
- HDU 5538 L - House Building 水题
L - House Building Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.ph ...
随机推荐
- 数据库SQL优化分析查询语句总结
方法一: SELECT TOP 10 TEXT AS 'SQL Statement' ,last_execution_time AS 'Last Execution Time' ,(total_log ...
- O048、掌握 cinder-scheduler 调度逻辑
参考https://www.cnblogs.com/CloudMan6/p/5589707.html 上一节我们详细讨论了cinder-api 和 cinder-volume ,今天讨论另一个重要 ...
- 【JavaScript】js中的构造函数,和构造函数的实例中的原型详解
1. 构造函数作为一个对象,他也有他的原型属性,即.prototype:该属性指向的原型对象是Object. 2. 而构造函数产生的实例却没有.prototype属性,但是作为一个对象,该实例却仍然拥 ...
- 微信小程序中button去除默认的边框
button { position:relative; display:block; margin-left:auto; margin-right:auto; padding-left:14px; p ...
- apache备忘录
apache多站点局域网访问: <VirtualHost *:80> DocumentRoot "E:/website/pxsj" ServerName host7.c ...
- 【Spring Cloud】 总结
一.Spring Cloud简介 简单来说,Spring Cloud 就是致力于分布式系统.微服务等的一套在目前非常火热的框架.但它的本身也是一系列框架的有序集合(由多个模块组成). 相比较于Dubb ...
- ubuntu 共享WIFI并分享主机的代理服务
背景是这样的: 公司内的主机访问外网需要通过一个HTTP代理服务器,主机ubuntu共享wifi给手机使用的时候需要在手机上配置一个代理才能访问互联网. 我觉得这样比较麻烦,所以想在主机上直接把共享w ...
- Mybatis和hibernate的优缺点比较
介绍: Hibernate :Hibernate 是当前最流行的ORM框架,对数据库结构提供了较为完整的封装. Mybatis:Mybatis同样也是非常流行的ORM框架,主要着力点在于POJO 与S ...
- TCP超时与重传
TCP提供可靠的传输层.它使用的方法之一就是确认从另一端收到的数据.但数据和确认都有可能丢失.TCP通过在发送时设置一个定时器来解决这种问题.如果当定时器溢出时还没收到确认,他就重传数该数据.对任何实 ...
- 网络初级篇之STP(实验验证)
一.根桥的选举. 1.优先级相等时. (图1-1) (图1-2) 在上面1-1图中,已经标出桥的mac地址,桥的优先级为默认优先级(缺省:32768).任意一端口抓包,查看STP数据包内包含的信息,根 ...