bzoj2093 Frog】的更多相关文章

题目链接 思路 非常有趣的一道题. 先考虑如何找出第K远的位置. 因为给出的序列是单调的,所以对于位置\(i\)的前\(K\)远位置肯定是一个包含位置\(i\)的长度为\(k+1\)的区间.我们用\(l\)表示这个区间的左端点,\(r\)表示这个区间的右端点.那么当\(i+1\)时,\(l\)和\(r\)都只会往右挪.而且往右挪的条件是第\(r+1\)个点与\(i+1\)的距离比第\(l\)个点与第\(i+1\)个点的距离小. 这样就可以找出每个位置的第k远位置.然后就得到了一个置换. 跳\(m…
2093: [Poi2010]Frog Time Limit: 10 Sec  Memory Limit: 259 MBSubmit: 568  Solved: 186[Submit][Status][Discuss] Description 一个条河无限宽,上面有n块石头,石头离左边的河岸(无限宽,右边河岸不晓得在哪)距离严格递增,现在Zxl想锻炼自己的跳跃能力(谁叫他在班里外号是鸟怪..畸形),他在某一块石头上,想跳到离他这块石头第k远的石头上去,假如离他第k远的石头不是唯一的,他就选离岸最…
从左往右维护两个指针l,r表示离i最近的k个点的区间,预处理出每个点出发的后继,然后倍增. #include<cstdio> typedef long long ll; const int N=1000010,BUF=20000000,OUT=8000000; int n,k,i,l=1,r,f[N],g[N],t[N],Outn[20],Outcnt;ll m,a[N];char Buf[BUF],*buf=Buf,Out[OUT],*ou=Out; inline ll read(){ll…
A frog is crossing a river. The river is divided into x units and at each unit there may or may not exist a stone. The frog can jump on a stone, but it must not jump into the water. Given a list of stones' positions (in units) in sorted ascending ord…
http://acm.hdu.edu.cn/showproblem.php?pid=5037 网络赛 北京 比较难的题 Frog Time Limit: 3000/1500 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 99    Accepted Submission(s): 11 Problem Description Once upon a time, there is…
C. Mike and Frog time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Mike has a frog and a flower. His frog is named Xaniar and his flower is named Abol. Initially(at time 0), height of Xaniar…
A frog is crossing a river. The river is divided into x units and at each unit there may or may not exist a stone. The frog can jump on a stone, but it must not jump into the water. Given a list of stones' positions (in units) in sorted ascending ord…
The Troublesome Frog Time Limit: 5000MS Memory Limit: 100000K Total Submissions: 9581 Accepted: 2883 Case Time Limit: 500MS Description In Korea, the naughtiness of the cheonggaeguri, a small frog, is legendary. This is a well-deserved reputation, be…
A frog is crossing a river. The river is divided into x units and at each unit there may or may not exist a stone. The frog can jump on a stone, but it must not jump into the water. Given a list of stones' positions (in units) in sorted ascending ord…
题目链接: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…