Description The annual Games in frogs' kingdom started again. The most famous game is the Ironfrog Triathlon. One test in the Ironfrog Triathlon is jumping. This project requires the frog athletes to jump over the river. The width of the river is L (…
import java.util.Arrays; import java.util.Scanner; //杭电oj 4004 //解题思路:利用二分法查找,即先选取跳跃距离的区间,从最大到最小, //然后去中值,并依次到judgeHigh函数判断是否满足条件,然后逐步逼近最终答案 public class Main { public static void main(String[] args) { Scanner in=new Scanner(System.in); while (in.has…
The Frog's Games Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65768/65768 K (Java/Others) Total Submission(s): 10307    Accepted Submission(s): 4686 Problem Description The annual Games in frogs' kingdom started again. The most famous game…
The Frog's Games Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65768/65768 K (Java/Others)Total Submission(s): 9678    Accepted Submission(s): 4428 The annual Games in frogs' kingdom started again. The most famous game is the Ironfrog Triat…
The Frog's Games Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65768/65768 K (Java/Others)Total Submission(s): 3263    Accepted Submission(s): 1596 Problem Description The annual Games in frogs' kingdom started again. The most famous game i…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4004 The annual Games in frogs' kingdom started again. The most famous game is the Ironfrog Triathlon. One test in the Ironfrog Triathlon is jumping. This project requires the frog athletes to jump over…
其实这个题呢,大白书上面有经典解法  题意是青蛙要跳过长为L的河,河上有n块石头,青蛙最多只能跳m次且只能跳到石头或者对面.问你青蛙可以跳的最远距离的最小值是多大 典型的最大值最小化问题,解法就是贪心二分.其实就是二分答案,再把每次二分出来的答案带入计算是否满足题意,以此来确定这个正确答案在此值的左区间还是右区间.可以这么做的依据是:对于二分出来的值x满足条件的话,则大于x(或者小于x)也满足条件,这样就得到一个单调的规律,满足二分. #include<set> #include<map…
题目链接 题意理解的有些问题. #include <iostream> #include<cstdio> #include<cstring> #include<algorithm> using namespace std; #define LL __int64 LL p[]; int n; int judge(int x,int m) { ,num = ,i; ;i <= n;i ++) { if(p[i] - pre <= x) ; else…
杭电ACM分类: 1001 整数求和 水题1002 C语言实验题——两个数比较 水题1003 1.2.3.4.5... 简单题1004 渊子赛马 排序+贪心的方法归并1005 Hero In Maze 广度搜索1006 Redraiment猜想 数论:容斥定理1007 童年生活二三事 递推题1008 University 简单hash1009 目标柏林 简单模拟题1010 Rails 模拟题(堆栈)1011 Box of Bricks 简单题1012 IMMEDIATE DECODABILITY…
The Frog's Games Problem Description The annual Games in frogs' kingdom started again. The most famous game is the Ironfrog Triathlon. One test in the Ironfrog Triathlon is jumping. This project requires the frog athletes to jump over the river. The…