hdu 1.3.4 shǎ崽 OrOrOrOrz】的更多相关文章

简单的排序,注意输出即可 #include <iostream> #include <algorithm> using namespace std; int main() { ]; int n,i; //int t = 0; while(cin>>n) { //if(t)cout<<endl; //t++; ; i<n; i++) { cin>>a[i]; } sort(a,a+n); ==) { ; i<=(n-)/; i++) c…
Problem Description Acmer in HDU-ACM team are ambitious, especially shǎ崽, he can spend time in Internet bar doing problems overnight. So many girls want to meet and Orz him. But Orz him is not that easy.You must solve this problem first. The problem…
#include <cstdio> #include <algorithm> using namespace std; int main() { int n; while (scanf("%d",&n)!=EOF) { ]; ; i<n; i++) scanf("%d",&a[i]); sort(a,a+n); ,end=n-,flag=; printf(]); while (begin<=end) { if (f…
题意:排序后按题目要求输出 思路:排序 #include<iostream> #include<stdio.h> #include<algorithm> using namespace std; int main(){ ],n,i,j; while(~scanf("%d",&n)){ ;i<n;++i) scanf("%d",&a[i]); sort(a,a+n); i=; j=n-; while(i<…
题目地址: http://acm.hdu.edu.cn/showproblem.php?pid=2673 拍两次序,交替输出 #include<iostream> #include<algorithm> #include<cstdio> using namespace std; #define MAX_NUMBER 10000 bool myfunction1 (int i,int j) { return (i<j); } bool myfunction2 (in…
问题描述 问题是: 为您提供了一系列不同的整数, 请选择 "数字" 如下: 首先选择最大的, 然后是最小的, 然后是第二个最大的, 第二个最小的. 直到所有的数字被选中.例如, 给你 1 2 3 4 5, 你应该输出 5 1 4 2 3 . 输入 有多个测试用例, 每个案例从一个整数 n (1 < = N < = 10000) 开始, 跟随 N 个不同的整数. 输出 输出上面描述的不同整数序列. 示例输入 5 1 2 3 4 5 样品输出 5 1 4 2 3 我们可以将输入…
注意输出格式 #include <iostream> #include <algorithm> using namespace std; +]; int main() { int n; while (cin>>n) { ; i<n; i++) cin>>arr[i]; sort(arr, arr+n); cout<<arr[n-]; ; i*<n-; i++) { == i){ cout<<" "<…
HDU 1000 A + B Problem  I/O HDU 1001 Sum Problem  数学 HDU 1002 A + B Problem II  高精度加法 HDU 1003 Maxsum  贪心 HDU 1004 Let the Balloon Rise  字典树,map HDU 1005 Number Sequence  求数列循环节 HDU 1007 Quoit Design  最近点对 HDU 1008 Elevator  模拟 HDU 1010 Tempter of th…
题意:是用两个指针的一个模拟时钟的时针和分针.两个指针形成一个角度.角度测量两个指针之间的最小角度.两只手之间的角度是大于或等于0,且小于或等于180度的度量.由于一个序列的五个不同的写入时间,格式为hh:mm,其中......是两个数字较完整的24小时( 00 <= ...... <= 23)和mm(00 <=毫米<= 59),你发现的中位数,也就是写一个程序,第三个元素的排序序列在两个数字代表分钟非递减顺序及其关联的角度.例如,假设您将得到一个序列(06:05,07:10,03…
LCIS Time Limit: 6000/2000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 6066    Accepted Submission(s): 2634 Problem Description Given n integers.You have two operations:U A B: replace the Ath number by B. (index…
http://acm.hdu.edu.cn/showproblem.php?pid=3345 Problem Description War chess is hh's favorite game:In this game, there is an N * M battle map, and every player has his own Moving Val (MV). In each round, every player can move in four directions as lo…
题目链接:http://acm.hdu.edu.cn/showproblem.php? pid=3308 LCIS Time Limit: 6000/2000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 5792    Accepted Submission(s): 2513 Problem Description Given n integers. You have two…
Max Sum of Max-K-sub-sequence Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 5335    Accepted Submission(s): 1939 Problem Description Given a circle sequence A[1],A[2],A[3]......A[n]. Circle se…
Max Sum of Max-K-sub-sequence Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 5690    Accepted Submission(s): 2059 Problem Description Given a circle sequence A[1],A[2],A[3]......A[n]. Circle s…
Sequence operation Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 4952    Accepted Submission(s): 1452 Problem Description lxhgww got a sequence contains n characters which are all '0's or '1…
Sequence operation Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 8308    Accepted Submission(s): 2507 Problem Description lxhgww got a sequence contains n characters which are all '0's or '1'…
Acmer in HDU-ACM team are ambitious, especially shǎ崽, he can spend time in Internet bar doing problems overnight. So many girls want to meet and Orz him. But Orz him is not that easy.You must solve this problem first. The problem is : Give you a sequ…
LCIS Time Limit: 6000/2000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 6592    Accepted Submission(s): 2866 Problem Description Given n integers.You have two operations:U A B: replace the Ath number by B. (index…
LCIS                                                              Time Limit: 6000/2000 MS (Java/Others)                                                                 Memory Limit: 65536/32768 K (Java/Others)                                       …
Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 7822    Accepted Submission(s): 2347 Problem Description lxhgww got a sequence contains n characters which are all '0's or '1's. We have five op…
博弈知识汇总 转自:http://www.cnblogs.com/kuangbin/archive/2011/08/28/2156426.html 有一种很有意思的游戏,就是有物体若干堆,可以是火柴棍或是围棋子等等均可.两个人轮流从堆中取物体若干,规定最后取光物体者取胜.这是我国民间很古老的一个游戏,别看这游戏极其简单,却蕴含着深刻的数学原理.下面我们来分析一下要如何才能够取胜. (一)巴什博奕(Bash Game):只有一堆n个物品,两个人轮流从这堆物品中取物,规定每次至少取一个,最多取m个.…
博弈知识汇总 有一种很有意思的游戏,就是有物体若干堆,可以是火柴棍或是围棋子等等均可.两个人轮流从堆中取物体若干,规定最后取光物体者取胜.这是我国民间很古老的一个游戏,别看这游戏极其简单,却蕴含着深刻的数学原理.下面我们来分析一下要如何才能够取胜. (一)巴什博奕(Bash Game):只有一堆n个物品,两个人轮流从这堆物品中取物,规定每次至少取一个,最多取m个.最后取光者得胜. 显然,如果n=m+1,那么由于一次最多只能取m个,所以,无论先取者拿走多少个,后取者都能够一次拿走剩余的物品,后者取…
Max Sum of Max-K-sub-sequence Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 7034    Accepted Submission(s): 2589 Problem Description Given a circle sequence A[1],A[2],A[3]......A[n]. Circle se…
因为是circle sequence,可以在序列最后+序列前n项(或前k项);利用前缀和思想,预处理出前i个数的和为sum[i],则i~j的和就为sum[j]-sum[i-1],对于每个j,取最小的sum[i-1],这就转成一道单调队列了,维护k个数的最小值. ---------------------------------------------------------------------------------- #include<cstdio> #include<deque&…
Max Sum of Max-K-sub-sequence Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 5084    Accepted Submission(s): 1842 Problem Description Given a circle sequence A[1],A[2],A[3]......A[n]. Circle s…
博弈知识汇总 有一种很有意思的游戏,就是有物体若干堆,可以是火柴棍或是围棋子等等均可.两个人轮流从堆中取物体若干,规定最后取光物体者取胜.这是我国民间很古老的一个游戏,别看这游戏极其简单,却蕴含着深刻的数学原理.下面我们来分析一下要如何才能够取胜. (一)巴什博奕(Bash Game):只有一堆n个物品,两个人轮流从这堆物品中取物,规定每次至少取一个,最多取m个.最后取光者得胜. 显然,如果n=m+1,那么由于一次最多只能取m个,所以,无论先取者拿走多少个,后取者都能够一次拿走剩余的物品,后者取…
Kakuro Extension Extension Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 507    Accepted Submission(s): 248 Problem Description You know ,I'm a lazy guy and write problem description is a very…
War chess is hh's favorite game:In this game, there is an N * M battle map, and every player has his own Moving Val (MV). In each round, every player can move in four directions as long as he has enough MV. To simplify the problem, you are given your…
LCIS Time Limit: 6000/2000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 8337    Accepted Submission(s): 3566 Problem Description Given n integers.You have two operations:U A B: replace the Ath number by B. (index…
LCIS Time Limit: 6000/2000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 7193    Accepted Submission(s): 3069 Problem Description Given n integers.You have two operations:U A B: replace the Ath number by B. (index…