我发这题只是想说明:有时候确实需要用水题来找找自信的~

  代码如下:

  1. #include <stdio.h>
  2. #include <algorithm>
  3. #include <string.h>
  4. using namespace std;
  5. typedef long long ll;
  6.  
  7. int num[+] = {,,,,,,,,,,,,,,,,,,,,};
  8. int sum[+];
  9.  
  10. void init()
  11. {
  12. for(int i=;i<=;i++) num[i] = + num[i-];
  13. num[] = ;
  14. for(int i=;i<=;i++) num[i] = + num[i-];
  15. num[] = ;num[] = ;num[] = ;num[] = ;num[] = ;num[] = ;
  16. for(int i = ;i<=;i++)
  17. {
  18. if(i%==) continue;
  19. else num[i] = num[i-i%] + num[i%];
  20. }
  21. num[] = ;
  22. for(int i=;i<=;i++)
  23. {
  24. if(i%==)
  25. {
  26. num[i] = num[i/] + ;
  27. }
  28. else
  29. {
  30. num[i] = ;
  31. num[i] += num[i-i%] + num[i%];
  32. }
  33. }
  34. num[] = ;
  35. for(int i=;i<=;i++) sum[i] = sum[i-] + num[i];
  36. }
  37.  
  38. int main()
  39. {
  40. init();
  41. int T;scanf("%d",&T);
  42. while(T--)
  43. {
  44. int n;scanf("%d",&n);
  45. printf("%d\n",sum[n]);
  46. }
  47. }

HDU 5867 Water problem ——(模拟,水题)的更多相关文章

  1. HDU 5867 Water problem (模拟)

    Water problem 题目链接: http://acm.split.hdu.edu.cn/showproblem.php?pid=5867 Description If the numbers ...

  2. HDU 5443 The Water Problem (水题,暴力)

    题意:给定 n 个数,然后有 q 个询问,问你每个区间的最大值. 析:数据很小,直接暴力即可,不会超时,也可以用RMQ算法. 代码如下: #include <cstdio> #includ ...

  3. HDU 5832 A water problem (水题,大数)

    题意:给定一个大数,问你取模73 和 137是不是都是0. 析:没什么可说的,先用char 存储下来,再一位一位的算就好了. 代码如下: #pragma comment(linker, "/ ...

  4. 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  ...

  5. HDU 5867 Water problem

    处理出1-99的,之后的加上多少hundred和and即可.整百和一千的时候注意一下. #pragma comment(linker, "/STACK:1024000000,10240000 ...

  6. HDOJ 2317. Nasty Hacks 模拟水题

    Nasty Hacks Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Tota ...

  7. fzuoj Problem 2182 水题

    http://acm.fzu.edu.cn/problem.php?pid=2182 Problem 2182 水题 Accept: 188    Submit: 277Time Limit: 100 ...

  8. POJ 2014:Flow Layout 模拟水题

    Flow Layout Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 3091   Accepted: 2148 Descr ...

  9. HDU 5538 L - House Building 水题

    L - House Building Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.ph ...

随机推荐

  1. sql当前时间往后半年

    select  DATEADD(MONTH, -6, GETDATE()) select  DATEADD(hh, -6, GETDATE())

  2. vue响应原理

    用Object.defineProperty添加属性的方法,给属性加get set方法.当我们操作属性的时候其实底层是在操作dom. <!DOCTYPE html> <html la ...

  3. opencv 模板匹配, 已解决模板过大程序不工作的bug

    #include <opencv2/opencv.hpp> #include <opencv2/highgui/highgui.hpp> #include <opencv ...

  4. STM32F10xxx_Keil中添加的预定义宏

    目录 STM32F10xxx_Keil中添加的预定义宏 更新记录 STM32F10xxx_Keil中添加的预定义宏 更新记录 version status description date autho ...

  5. npm 设置淘宝镜像

    永久 npm config set registry https://registry.npm.taobao.org 直接安装 cnpm 替代 npm npm install -g cnpm --re ...

  6. springboot2.0集成webSocket

    WebSocket和http的区别? http协议是用在应用层的协议,他是基于tcp协议的,http协议建立链接也必须要有三次握手才能发送信息. http链接分为短链接,长链接,短链接是每次请求都要三 ...

  7. Python中文转为拼音

    # -*- coding: utf-8 -*-import sys def openTable(): f = open('gb-pinyin.table', 'r') table = f.read() ...

  8. 解决xshell连接不上阿里云服务器问题

    最近购买了阿里云服务器准备玩玩,但是使用xshell连接阿里云服务器时,系统一直提示“Connection established. To escape to local shell, press ' ...

  9. BLE 5协议栈-属性协议层(ATT)

    文章转载自:http://www.sunyouqun.com/2017/04/page/2/ 属性协议(Attribute Protocol)简称ATT. ATT层定义了属性实体的概念,包括UUID. ...

  10. 一、CentOS 7安装部署GitLab服务器

    一.CentOS 7安装部署GitLab服务器 1.安装依赖软件 yum -y install policycoreutils policycoreutils-python openssh-serve ...