HDU 2009 (水)】的更多相关文章

题目链接:HDU 2009 Description 数列的定义如下: 数列的第一项为n,以后各项为前一项的平方根,求数列的前m项的和. Input 输入数据有多组,每组占一行,由两个整数n(n<10000)和m(m<1000)组成,n和m的含义如前所述. Output 对于每组输入数据,输出该数列的和,每个测试实例占一行,要求精度保留2位小数. Sample Input 81 4 2 2 Sample Output 94.73 3.41 代码 import java.util.*; class…
N! Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others) Total Submission(s): 64256    Accepted Submission(s): 18286 Problem Description Given an integer N(0 ≤ N ≤ 10000), your task is to calculate N!   Input One N in…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2009 题目大意:数列的第一项为n,以后各项为前一项的平方根,求数列的前m项的和 解题思路: 用好sqrt() 函数 #include<iostream> #include<cmath> #include<iomanip> using namespace std; int main() { double m; int n; while(cin >> m >&…
http://acm.hdu.edu.cn/showproblem.php?pid=4464 现场赛总会有水题,这就是最水的一道,预计也就是能当高校的上机题,保研用,呵呵~~~ #include <cstdio> #include <cstring> #include <iostream> using namespace std; #define ll long long const int MAXN= 100+20; char s[MAXN]; int main()…
E - 5 Time Limit:1500MS     Memory Limit:262144KB     64bit IO Format:%I64d & %I64u Submit Status Practice HDU 5391 Description Tina Town is a friendly place. People there care about each other. Tina has a ball called zball. Zball is magic. It grows…
水题 /* * Author : ben */ #include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> #include <ctime> #include <iostream> #include <algorithm> #include <queue> #include <set> #include <m…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3357 #include <cstdio> #include <cmath> #include <algorithm> #include <iostream> #include <cstring> #include <queue> #include <vector> #define maxn 250 #define maxe 1…
http://acm.hdu.edu.cn/showproblem.php?pid=5007 纯粹的联系String的substr 什么时候substr拦截比写短话 string te; int n; te="Hellow"; cout << te.substr(3,5); 我试了下 打印出来的是low.... 写的时候没去限制边界还是AC了 //#pragma comment(linker, "/STACK:102400000,102400000")…
HDU - 1260 现在有n个人要买电影票,如果知道每个人单独买票花费的时间, 还有和前一个人一起买花费的时间,问最少花多长时间可以全部买完票. 直接dp就行,注意下输出和初始化 每次从dp[i-1]和dp[i-2]里面选一个就好 #include <bits/stdc++.h> #define ll long long #define IO ios::sync_with_stdio(false);cin.tie(0);cout.tie(0) #define pp pair<int,i…
1040水题; These days, I am thinking about a question, how can I get a problem as easy as A+B? It is fairly difficulty to do such a thing. Of course, I got it after many waking nights.Give you some integers, your task is to sort these number ascending (…