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

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=2001 题目大意:两个点求距离 解题思路: 套基本公式 a = √(b2 + c2); 小数点后几位的表示方法,用std命名空间中常见的的流控制符,用到setprecision函数和<iomanip>头文件,fixed是非科学记数法的普通表示: ax == pow(a, x); pow(),sqrt()均在<math>里 代码: #include<iostream> #inc…
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()…
http://acm.hdu.edu.cn/showproblem.php?pid=2001 Problem Description 输入两点坐标(X1,Y1),(X2,Y2),计算并输出两点间的距离.   Input 输入数据有多组,每组占一行,由4个实数组成,分别表示x1,y1,x2,y2,数据之间用空格隔开.   Output 对于每组输入数据,输出一行,结果保留两位小数.   Sample Input 0 0 0 1 0 1 1 0   Sample Output 1.00 1.41  …
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 (…
题意:判断一些数里有最大因子的数 水题,省赛即将临近,高效的代码风格需要养成,为了简化代码,以后可能会更多的使用宏定义,但是通常也只是快速拿下第一道水题,涨自信.大部分的代码还是普通的形式,实际上能简化的部分也不太多 #include<iostream> #include<cstring> #include<cmath> #include<cstdio> using namespace std; #define for0n for(i=0;i<n;i+…
哈密顿绕行世界问题 Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1039    Accepted Submission(s): 643 Problem Description 一个规则的实心十二面体,它的 20个顶点标出世界著名的20个城市,你从一个城市出发经过每个城市刚好一次后回到出发的城市.    Input 前20行的第i行有3…
/* 对于只会弗洛伊德的我,迪杰斯特拉有点不是很理解,后来发现这主要用于单源最短路,稍稍明白了点,不过还是很菜,这里只是用了邻接矩阵 套模板,对于邻接表暂时还,,,没做题,后续再更新.现将这题贴上,应该是迪杰斯特拉最水的题没有之一.纯模板 找到距离起点最近的点,以此点为中间点进行更新,找到了在进行下一个点. */ 题目大意: 搬东西很累,想省力,给你几个点和点之间的距离:标准题型: #include<stdio.h> #include <iostream> #include<…
http://acm.hdu.edu.cn/showproblem.php?pid=5038 就是求个众数  这个范围小 所以一个数组存是否存在的状态即可了 可是这句话真恶心  If not all the value are the same but the frequencies of them are the same, there is no mode. 事实上应该是这个意思: 当频率最高的有多个的时候. 假设 全部的grade出现的频率都是相等的,那么是没有mode的 否则依照升序 当…
Starship Hakodate-maru Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 751    Accepted Submission(s): 518 Problem Description The surveyor starship Hakodate-maru is famous for her two fuel conta…
题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5162 题解:看了半天以为测试用例写错了.这题玩文字游戏.它问的是当前第i名是原数组中的第几个. #include<stdio.h> #include<iostream> #include<string.h> #include <stdlib.h> #include<math.h> #include<algorithm> #include…
题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5138 反着来. #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> #include<cmath> #include <queue> using namespace std; int main() { ] = {,,,,}; int n; w…
#include<cstdio> #include<iostream> #include<algorithm> #include<cstring> #include<cmath> #include<queue> #include<map> using namespace std; #define MOD 1000000007 const int INF=0x3f3f3f3f; ; typedef long long ll;…
纯暴力就能过的,可是题目描述真心不清楚,我看了好久好久才明白题目啥意思. 为了迅速打完,代码比较冗余. /* * Author : ben */ #include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> #include <ctime> #include <iostream> #include <algorithm> #include…
最小公倍数最大,也就是尽量让2个数互质,所以把n除以2 从中间向两边找就够了,自己写几组数据就能发现规律. 注意longlong存 #include<cstdio> #include<cstring> #include<algorithm> #include<iostream> using namespace std; int main() { int cas; long long s,n; cin>>cas; while(cas--) { ci…
题意:按照年龄从小到大排序 名字中可能有空格什么的,处理下即可 #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> using namespace std; typedef long long ll; #define maxn 105 #define mod 1000000007 char tt[150]; struct node { int x; char id…
题意:最大困难=距离 / 相邻时间 #include<cstring> #include<cstdio> #include<cmath> #define ll double ll num[][]; #define max(a, b) (a)>(b)?(a):(b) int main() { int t; scanf("%d", &t); while (t--) { int n; scanf("%d", &n)…
题意:出现Apple.iPod.iPhone.iPad时输出MAI MAI MAI!,出现Sony,输出SONY DAFA IS GOOD! Sample InputApple bananaiPad lemon ApplepiSony233Tim cook is doubi from AppleiPhoneipadiPhone30 is so biiiiiiig Microsoftmakes good App. Sample OutputMAI MAI MAI!MAI MAI MAI!MAI M…
题意:我们建造了一个大项目!这个项目有n个节点,用很多边连接起来,并且这个项目是连通的!两个节点间可能有多条边,不过一条边的两端必然是不同的节点.每个节点都有一个能量值.现在我们要编写一个项目管理软件,这个软件呢有两个操作: 1.给某个项目的能量值加上一个特定值.2.询问跟一个项目相邻的项目的能量值之和.(如果有多条边就算多次,比如a和b有2条边,那么询问a的时候b的权值算2次). 链接:点我 暴力过 #include<cstdio> #include<iostream> #inc…
题意:n个点m条边,找点集个数,点集满足有任意三个点成环,或者三个点互不相连 题解:暴力复杂度O(n^5/120*O(ok))==O(能过) //#pragma comment(linker, "/stack:200000000") //#pragma GCC optimize("Ofast,no-stack-protector") //#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,…
n*n*n的图形,m条线,每条线上的方格被删除.问一共删除了多少个方格 ans=m*n .然后推断一下直线相交的交点.去重就可以 #include "stdio.h" #include "string.h" int xy[1010][1010],xz[1010][1010],yz[1010][1010],hash[1010]; struct node { int x,y,z; } mark[1010]; int main() { int Case,n,m,i,j,c…
Go to movies Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1029    Accepted Submission(s): 543 Problem Description Winter holiday is coming!As the monitor, LeLe plans to go to the movies.Becau…
背景:简单字符串处理,尽管有点绕. #include<cstdio> #include<iostream> #include<cstring> #include<queue> #include<algorithm> using namespace std; int ans[510]; char str[1009]; int main(void){ while(~scanf("%s",str)){ memset(ans,0,si…
Missing number Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1020    Accepted Submission(s): 518 Problem Description There is a permutation without two numbers in it, and now you know what num…
Have meal Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 756    Accepted Submission(s): 507 Problem Description I have been in school for several years, so I have visited all messes here. Now I…