题目大意:http://acm.hdu.edu.cn/showproblem.php?pid=2520

我是菜鸟,我怕谁

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 7698    Accepted Submission(s):
4505

Problem Description
lin2144是一只小菜鸟,都是笨鸟先飞,lin2144想来个菜鸟先飞,他从0点出发
一开始的飞行速度为1m/s,每过一个单位时间lin2144的飞行速度比上一个单位时间的飞行速度快2m/s,问n
(0 < n < 10^5)个单位时间之后lin2144飞了多远?
 
Input
输入一个T表示为有几组数据
每组数据输入一个n,表示lin2144飞行的时间.
 
Output
输出lin2144飞行了多远,因为数字很大,所以对10000取模.
 
Sample Input
2
1
2
 
Sample Output
1
4
 
Source
 
 
题目大意:,每过一个单位时间飞行速度比上一个单位时间的飞行速度快2m/s,所以用两个数组,一个来记录距离,一个来记录速度,这样就ok了。
 
详见代码。
 #include <iostream>
#include <cstdio> using namespace std; int num1[],num2[]; int main()
{
num1[]=;
num2[]=;
for (int i=; i<; i++)
{
num2[i]=(num1[i-]+num2[i-])%;
num1[i]=num1[i-]+;
}
int t;
scanf("%d",&t);
while (t--)
{
int n;
scanf("%d",&n);
printf ("%d\n",num2[n]); }
return ;
}
 

H题 hdu 2520 我是菜鸟,我怕谁的更多相关文章

  1. HDU 2520 我是菜鸟我怕谁

    2019-05-27 17:52:01 加油!!! 看题时候就要仔细,最后容易忘记%10000 #include <bits/stdc++.h> using namespace std; ...

  2. HDU 2520 我是菜鸟,我怕谁

    我是菜鸟,我怕谁 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Su ...

  3. [HDU 2520] 我是菜鸟,我怕谁(不一样的for循环)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2520 //学学不一样的for循环 #include<iostream> #include& ...

  4. HDOJ(HDU) 2520 我是菜鸟,我怕谁(等差数列)

    Problem Description lin2144是一只小菜鸟,都是笨鸟先飞,lin2144想来个菜鸟先飞,他从0点出发 一开始的飞行速度为1m/s,每过一个单位时间lin2144的飞行速度比上一 ...

  5. HDU2520 我是菜鸟,我怕谁

    http://acm.hdu.edu.cn/showproblem.php?pid=2520 我是菜鸟,我怕谁 Time Limit: 2000/1000 MS (Java/Others) Memor ...

  6. 我是菜鸟,我怕谁(hdu2520)

    我是菜鸟,我怕谁 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total S ...

  7. 我是菜鸟,我怕谁--hdu2520

    我是菜鸟,我怕谁 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Su ...

  8. hdu 4548 第六周H题(美素数)

    第六周H题 - 数论,晒素数 Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u   De ...

  9. [Bayesian] “我是bayesian我怕谁”系列 - Variational Autoencoders

    本是neural network的内容,但偏偏有个variational打头,那就聊聊.涉及的内容可能比较杂,但终归会 end with VAE. 各个概念的详细解释请点击推荐的链接,本文只是重在理清 ...

随机推荐

  1. HDU 2068 Choose the best route

    http://acm.hdu.edu.cn/showproblem.php?pid=2680 Problem Description One day , Kiki wants to visit one ...

  2. ipython matplotlib

    matplotlib实际上是一套面向对象的绘图库,它所绘制的图表中的每个绘图元素,例如线条Line2D.文字Text.刻度等在内存中都有一个对象与之对应.为了方便快速绘图matplotlib通过pyp ...

  3. 【bzoj4491】我也不知道题目名字是什么 离线扫描线+线段树

    题目描述 给定一个序列A[i],每次询问l,r,求[l,r]内最长子串,使得该子串为不上升子串或不下降子串 输入 第一行n,表示A数组有多少元素接下来一行为n个整数A[i]接下来一个整数Q,表示询问数 ...

  4. 【hdu3555】Bomb 数位dp

    题目描述 求 1~N 内包含数位串 “49” 的数的个数. 输入 The first line of input consists of an integer T (1 <= T <= 1 ...

  5. (转)超详细单机版搭建hadoop环境图文解析

                        超详细单机版搭建hadoop环境图文解析   安装过程: 一.安装Linux操作系统 二.在Ubuntu下创建hadoop用户组和用户 三.在Ubuntu下安装 ...

  6. [BZOJ4822] [CQOI2017] 老C的任务

    题目链接 BZOJ:https://lydsy.com/JudgeOnline/problem.php?id=4822. 洛谷:https://www.luogu.org/problemnew/sho ...

  7. [Leetcode] valid parentheses 有效括号对

    Given a string containing just the characters'(',')','{','}','['and']', determine if the input strin ...

  8. exBSGS板子

    /*bzoj2480*/ #include <map> #include <cmath> #include <cstdio> #include <cstrin ...

  9. C++分离字符串中的数字和字符 转

    #include <iostream> #include <string> #include <vector> using namespace std; void ...

  10. JS传递中文参数出现乱码的解决办法

    一.window.open() 乱码: JS中使用window.open("url?param="+paramvalue)传递参数出现乱码,提交的时候,客户端浏览器URL中显示参数 ...