E-COM-NET
首页
在线工具
Layui镜像站
SUI文档
联系我们
推荐频道
Java
PHP
C++
C
C#
Python
Ruby
go语言
Scala
Servlet
Vue
MySQL
NoSQL
Redis
CSS
Oracle
SQL Server
DB2
HBase
Http
HTML5
Spring
Ajax
Jquery
JavaScript
Json
XML
NodeJs
mybatis
Hibernate
算法
设计模式
shell
数据结构
大数据
JS
消息中间件
正则表达式
Tomcat
SQL
Nginx
Shiro
Maven
Linux
hopscotch
NOIP 2015 d2t1【poj 3258】 River
Hopscotch
二分
RiverHopscotchTimeLimit:2000MSMemoryLimit:65536KTotalSubmissions:10628Accepted:4558DescriptionEveryyearthecowsholdaneventfeaturingapeculiarversionofhopscotchthatinvolvescarefullyjumpingfromrocktorocki
ALPS233
·
2016-04-01 09:00
【poj 3258】River
Hopscotch
中文题意&题解&代码
RiverHopscotchTimeLimit:2000MSMemoryLimit:65536KTotalSubmissions:10631Accepted:4560DescriptionEveryyearthecowsholdaneventfeaturingapeculiarversionofhopscotchthatinvolvescarefullyjumpingfromrocktorocki
WilliamCode
·
2016-04-01 09:00
【poj 3258】River
Hopscotch
题意&题解&代码(C++)
题目链接:http://poj.org/problem?id=3258题意:题意:牛要到河对岸,在与河岸垂直的一条线上,河中有N块石头,给定河岸宽度L,以及每一块石头离牛所在河岸的距离,现在要求去掉M块石头,要求去掉M块石头后,剩下的石头之间以及石头与河岸的最小距离的最大值。题解:这好像是noip的那道原题啊233.。。。多亏了这个L的范围当时才能敲出来二分。。。。代码:#include#incl
deritt
·
2016-04-01 09:26
oi之路
poj
DERIT的博客专栏
【poj 3258】River
Hopscotch
题意&题解&代码(C++)
题目链接:http://poj.org/problem?id=3258题意:题意:牛要到河对岸,在与河岸垂直的一条线上,河中有N块石头,给定河岸宽度L,以及每一块石头离牛所在河岸的距离,现在要求去掉M块石头,要求去掉M块石头后,剩下的石头之间以及石头与河岸的最小距离的最大值。题解:这好像是noip的那道原题啊233.。。。多亏了这个L的范围当时才能敲出来二分。。。。代码:#include #inc
DERITt
·
2016-04-01 09:00
poj
二分
poj 3050
Hopscotch
(暴力dfs)
问题描述Thecowsplaythechild'sgameofhopscotchinanon-traditionalway.Insteadofalinearsetofnumberedboxesintowhichtohop,thecowscreatea5x5rectilineargridofdigitsparalleltothexandyaxes.Theythenadroitlyhopontoany
qq_31237061
·
2016-03-21 09:00
River
Hopscotch
(贪心)
RiverHopscotchTimeLimit:2000MS MemoryLimit:65536KB 64bitIOFormat:%I64d&%I64uSubmit Status Practice POJ3258DescriptionEveryyearthecowsholdaneventfeaturingapeculiarversionofhopscotchthatinvolves
liangzhaoyang1
·
2016-03-13 17:00
贪心
river
hopscotch
Pku oj 3258 River
Hopscotch
(二分搜索)
RiverHopscotchTimeLimit: 2000MS MemoryLimit: 65536KTotalSubmissions: 10512 Accepted: 4506DescriptionEveryyearthecowsholdaneventfeaturingapeculiarversionofhopscotchthatinvolvescarefullyjumpingfromrockt
Sara_YF
·
2016-03-13 11:00
二分
poj3258
POJ3258-River
Hopscotch
-二分+贪心【最小值最大化】
给你L,n,mL是一条路总长度n是路上n个石头m是要移走m个石头(第一个和最后一个石头不能移走) 设X为剩下的n-m个石头里,石头之间相邻最近的距离求这个X的最大值二分X,对于每个X,我们贪心,从a[0]开始,把a[i]+x范围内的j个石头都移掉,接下来从i+j+1开始重复移石头。如果最后移动的石头超过了m个,那么说明这个X太大了答案取【left,mid-1】,如果小于等于m个,那么说明答案在[m
viphong
·
2016-02-27 11:00
POJ 3050
Hopscotch
POJ3050题目大意如下:这也是一道暴力搜索,直接DFS,代码如下#include #include #include #include usingnamespacestd; intdirX[]={0,1,0,-1}; intdirY[]={1,0,-1,0}; intGrap[6][6]; intsum; mapdata; voiddfs(inti,intj,intflag,inttest
kornberg_fresnel
·
2016-02-26 20:00
搜索
ACM
ICPC
DFS
暴力
poj 3258 River
Hopscotch
二分查找
点击打开链接题意:题意:牛要到河对岸,在与河岸垂直的一条线上,河中有N块石头,给定河岸宽度L,以及每一块石头离牛所在河岸的距离,现在去掉M块石头,要求去掉M块石头后,剩下的石头之间以及石头与河岸的最小距离的最大值max。思路;对要保留的最小距离的最大值max进行二分枚举#include #include #include #include #include #include #include #d
became_a_wolf
·
2016-02-24 11:00
POJ 3258 River
Hopscotch
简单题和poj3273MonthlyExpense相似。。#include #include usingnamespacestd; intmain() { intl,n,m; intdistance[50010]; scanf("%d%d%d",&l,&n,&m); inti; for(i=1;i=mid) { z=distance[i]; } else { count++; } } if(cou
qq_32995183
·
2016-02-16 20:00
poj
POJ3258-River
Hopscotch
-二分答案
一条河里有一串石头,给出石头间的间距,让你去掉m个石头,使最短间距最大。二分答案,对于每一种mid,判断要不要删除这块石头。然后逼近答案。#include #include #include usingnamespacestd; intdist[50010],save[50010],L,N,M; intmain() { while(~scanf("%d%d%d",&L,&
Helica
·
2016-01-31 19:00
Hopscotch
(POJ 3050 DFS)
HopscotchTimeLimit: 1000MS MemoryLimit: 65536KTotalSubmissions: 2845 Accepted: 1995DescriptionThecowsplaythechild'sgameofhopscotchinanon-traditionalway.Insteadofalinearsetofnumberedboxesintowhichtohop
御心飞行
·
2016-01-22 14:00
Acjoy群赛02-C -
HopscotcH
#include #include #include intarr[5][5],ans; constintdir[4][2]={0,1,0,-1,1,0,-1,0}; std::mapmp;//利用map查重,本来是用set的,然后超时233.。。 voidDFS(intx,inty,intk,intsum){ if(k==6){ if(mp[sum]++==0)++ans; return;
qq_31138083
·
2015-12-21 16:00
POJ 3050
Hopscotch
(dfs,暴力搜索)
HopscotchTimeLimit: 1000MS MemoryLimit: 65536KTotalSubmissions: 2780 Accepted: 1944DescriptionThecowsplaythechild'sgameofhopscotchinanon-traditionalway.Insteadofalinearsetofnumberedboxesintowhichtoh
zwj1452267376
·
2015-12-15 17:00
【BZOJ】1650: [Usaco2006 Dec]River
Hopscotch
跳石子(二分+贪心)
http://www.lydsy.com/JudgeOnline/problem.php?id=1650 看到数据和最小最大时一眼就是二分。。。 但是仔细想想好像判断时不能贪心? 然后看题解还真是贪心。。囧。 原来是之前我脑残了。 。。。 贪心很简单 排序后。 当前点到之前的点的距离<m就累计(相当于删掉这个点,为什么呢?因为这个点假设last到的不是0,那么这个点删了后,因
·
2015-11-13 11:49
USACO
POJ3258-River
Hopscotch
转载请注明出处:優YoU http://user.qzone.qq.com/289065406/blog/1301820293 大致题意: 一条河长度为 L,河的起点(Start)和终点(End)分别有2块石头,S到E的距离就是L。 河中有n块石头,每块石头到S都有唯一的距离 问现在要移除m块石头(S和E除外),每次移除的是与当前最短距离相关联的石头,要求
·
2015-11-13 09:57
poj
poj 3258 River
Hopscotch
【二分】
题目真是不好读,大意例如以下(知道题意就非常好解了) 大致题意: 一条河长度为 L,河的起点(Start)和终点(End)分别有2块石头,S到E的距离就是L。 河中有n块石头,每块石头到S都有唯一的距离 问如今要移除m块石头(S和E除外),每次移除的是与当前最短距离相关联的石头,要求移除m块石头后,使得那时的最短距离尽可能大,输出那个最短距离。 //Memory Time //42
·
2015-11-13 05:13
poj
POJ 3258 \poj 3273\poj 3122 【二分】
POJ 3258 River
Hopscotch
http://poj.org/problem?
·
2015-11-12 22:38
poj
搜索 & 查找
value = Ki, check Ki) 牛顿迭代(结果在单调区间上的高次方程) POJ 3122, Pie POJ 1905, Expanding Rods POJ 3258, River
Hopscotch
·
2015-11-12 19:01
搜索
POJ 3258, River
Hopscotch
Accepted: 784 Description Every year the cows hold an event featuring a peculiar version of
hopscotch
·
2015-11-12 19:57
poj
poj3258River
Hopscotch
http://poj.org/problem?id=3258 View Code 1 #include <iostream> 2 #include<cstdio> 3 #include<cstring> 4 #include<stdlib.h> 5 #include<cmath> 6 #include&l
·
2015-11-12 18:07
poj
POJ 3258 River
Hopscotch
Description Every year the cows hold an event featuring a peculiar version of
hopscotch
that involves
·
2015-11-12 15:20
poj
POJ 3258 River
Hopscotch
(二分搜索巧妙利用)
题意: 一条长为l(1~1,000,000,000)的河中,有n(1~50,000)块可垫脚的石头(不包括起始点和终点的), 给出它们与起始点的距离rock[i],现在要你移除其中的m块,使得具有最小间距的相邻两块石头之间的距离最大。 思路: 1. 和 POJ 3273 一样的技巧,都是要 求“上(下)界的最小(大)值”问题,以后遇到类似的可以用二分的思路往上面靠; 2. 假设要输出的最
·
2015-11-12 13:55
poj
POJ3258River
Hopscotch
(二分)
http://poj.org/problem?id=3258 题意:有一条很长很直的河距离为L,里边有n块石头,不包括起点和终点的那两块石头,奶牛们会从一个石头跳到另外一个,但因为有的石头隔得太近了,所以需要删除m块石头,来增大石头之间的最小距离。求删掉m块石头之后的其中两块石头的最小距离 。 思路 :这个题的和3273思路代码都很像,不过这个可能难理解一点,也是二分的思路。 #in
·
2015-11-11 15:12
poj
River
Hopscotch
(二分)
Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 5473 Accepted: 2379 Description Every year the cows hold an event featuring a peculiar version
·
2015-11-11 12:46
PS
二分搜索 POJ 3258 River
Hopscotch
题目传送门 1 /* 2 二分:搜索距离,判断时距离小于d的石头拿掉 3 */ 4 #include <cstdio> 5 #include <algorithm> 6 #include <cstring> 7 #include <cmath> 8 using namespace std; 9 10 typed
·
2015-11-11 01:00
poj
poj3258——二分优化
poj3258——二分优化 River
Hopscotch
Time Limit: 2000MS Memory Limit: 65536K Total
·
2015-11-11 00:06
poj
poj 3258 River
Hopscotch
最小值的最大化问题!!!二分搞定…… 代码如下: 1 #include<iostream> 2 #include<stdio.h> 3 #include<algorithm> 4 #include<iomanip> 5 #include<cmath> 6 #include<cstri
·
2015-11-08 15:04
poj
poj 3258 River
Hopscotch
题目大意:一群牛要过河,河中有许多石墩,FJ为了锻炼牛的跳跃力,将其中的m个石墩摘掉,求所有情况中最大的跳跃最小值。 思路:用一个变量sum累加,跳跃值mid通过二分来枚举。 (1)如果可以摘除的石墩超过m的话,说明牛的跳跃值太大了,并不是最小跳跃值。 (2)如果可以摘除的石墩刚好等于m的话,也不一定是最小的。 (3)如果小于m的话,说明mid偏小。 CO
·
2015-11-08 11:42
poj
POJ 3258 River
Hopscotch
二分枚举
题目:http://poj.org/problem?id=3258 又A一道,睡觉去了。。 1 #include <stdio.h> 2 #include <algorithm> 3 4 int d[50010]; 5 int s, n, m; 6 7 bool judge(int mid) 8 { 9 int su
·
2015-11-02 11:32
poj
BZOJ3939 : [Usaco2015 Feb]Cow
Hopscotch
设f[i][j]表示到(i,j)的方案数,则有 $f[i][j]=\sum f[x][y](x<i,y<j,a[x][y]!=a[i][j])=\sum f[x][y](x<i,y<j)-\sum f[x][y](x<i,y<j,a[x][y]==a[i][j])$ 然后运用CDQ分治即可$O(nm\log n)$解决。 #include
·
2015-10-31 11:51
USACO
2014年7月19日——比赛题取石头问题1
参考地址: http://blog.csdn.net/abcjennifer/article/details/5922699 River
Hopscotch
Time Limit: 
·
2015-10-31 10:56
问题
POJ-3258 River
Hopscotch
二分查找+贪心
这题给定一个系列的石头,求去除一些石头后,相邻两个石头的距离最小值最大。 一个判定的贪心规则就是当枚举长度为D的时候,那么我们查看[0, 1]的距离是否大于D,如果小于的话,那么就直接删除掉1号点,再判定[0,2]是否满足,如果[0,2]满足了的话,那么就把2作为起点继续即可。 代码如下: #include <iostream> #include <cstdlib>
·
2015-10-27 14:23
二分查找
[ACM] POJ 3258 River
Hopscotch
(二分,最大化最小值)
River
Hopscotch
Time Limit: 2000MS Memory Limit: 65536K Total Submissions
·
2015-10-21 12:05
ACM
BZOJ 3939 [Usaco2015 Feb]Cow
Hopscotch
线段树
题意:有一个r*c的图。每个格子有权值,从一个格子只能跳到在他的严格右下方权值不同的格子上。询问从左上角格子跳到右下角格子的方案数。解析:考虑暴力递推f[i][j]=∑f[k][l],k #include #include #include #defineN800 #defineM6001000 #definemod1000000007 usingnamespacestd; structnode
wzq_QwQ
·
2015-09-30 20:00
线段树
C语言
color
POJ 3258:River
Hopscotch
二分的好想法
RiverHopscotchTimeLimit: 2000MS MemoryLimit: 65536KTotalSubmissions: 9326 Accepted: 4016DescriptionEveryyearthecowsholdaneventfeaturingapeculiarversionofhopscotchthatinvolvescarefullyjumpingfromrockto
u010885899
·
2015-08-31 18:00
POJ 3258 River
Hopscotch
(二分)
本题是二分求最小值最大化。本题在[0,l]的区间内是满足单调性的,随着长度的递增,所需要拆除的石头数量也是递增的,这就满足了二分的条件。我们用二分找到拆除石头数量为m的最大值就OK了。#pragmawarning(disable:4996) #include #include usingnamespacestd; inta[50005]; intl,n,m; intget(intx){//返回距
acraz
·
2015-08-29 07:00
POJ 3258 River
Hopscotch
(二分求最小中的最大)
SampleInput2552 2 14 11 21 17SampleOutput4题目大意:在n块石头中删除m块石头(不含起始,和结束的石头),求出题目中的最小距离的最大距离。思路:二分问题,确定上下界,后进行区间的枚举,注意最后的输出时,要的是不断矿大时的mid值,这样才保证最大。#include #include #include #include #include #include #de
Grit_ICPC
·
2015-08-27 10:00
二分
POJ3258--------River
Hopscotch
RiverHopscotchTimeLimit:2000MS MemoryLimit:65536KTotalSubmissions:9266 Accepted:3997题意:河宽为L的河中有n块石子,去掉m块,求石子间距离最小值的最大值;思路:没想到用二分;知道后1A;二分大法好!DescriptionEveryyearthecowsholdaneventfeaturingapeculiarver
lv414333532
·
2015-08-24 14:00
【POJ 3258】 River
Hopscotch
(二分)
【POJ3258】RiverHopscotch一窝牛要过河河宽l河中有n个许多石块每个对应与牛所在的岸边有个距离现在想要去掉m个石块后最小距离最大问怎么去二分最小值最大化代码如下:#include #include #include usingnamespacestd; intp[50002]; intn,m; boolcan(intx) { inti,j,cnt=m; for(i=0,j
ChallengerRumble
·
2015-08-23 20:00
二分最小值最大化
POJ3258-- River
Hopscotch
题目大意:Farmer John来观看一群牛在河里玩跳格子游戏,他想增加观赏性,所以,准备给这个游戏增加难度,河里原先有N个石头作为落脚点,现在,他要拿走M个石头,来增加这些牛每次跳的最短距离。从河岸的起点0开始,跳往河里石头,结束于另一岸的终点L。开始问怎么样拿,使得最短距离最大? 分析:最大化最小值,自然用二分法。相邻两个落脚点间距离要不小于d,也就是说任意两个落脚点间距离要不小于d,这样问题
hhhhhhj123
·
2015-08-22 20:00
POJ 3258 River
Hopscotch
(二分,最大化最小值)
DescriptionEveryyearthecowsholdaneventfeaturingapeculiarversionofhopscotchthatinvolvescarefullyjumpingfromrocktorockinariver.Theexcitementtakesplaceonalong,straightriverwitharockatthestartandanotherro
Misdom_Tian_Ya
·
2015-08-21 15:00
POJ 3050
Hopscotch
(穷竭搜索)
题目链接:http://poj.org/problem?id=3050题面:HopscotchTimeLimit:1000MSMemoryLimit:65536KTotalSubmissions:2563Accepted:1823DescriptionThecowsplaythechild'sgameofhopscotchinanon-traditionalway.Insteadofalinear
David_Jett
·
2015-08-09 10:19
编程题——搜索
POJ 3050
Hopscotch
(穷竭搜索)
题目链接:http://poj.org/problem?id=3050题面:HopscotchTimeLimit:1000MS MemoryLimit:65536KTotalSubmissions:2563 Accepted:1823DescriptionThecowsplaythechild'sgameofhopscotchinanon-traditionalway.Insteadofaline
David_Jett
·
2015-08-09 10:00
搜索
poj
穷竭搜索
POJ3258—River
Hopscotch
—二分法求the largest mimmun
DescriptionEveryyearthecowsholdaneventfeaturingapeculiarversionofhopscotchthatinvolvescarefullyjumpingfromrocktorockinariver.Theexcitementtakesplaceonalong,straightriverwitharockatthestartandanotherro
sinat_30062549
·
2015-07-31 21:00
二分法
poj
最大最小值
POJ 3258 River
Hopscotch
(二分)
RiverHopscotchTimeLimit: 2000MS MemoryLimit: 65536KTotalSubmissions: 8423 Accepted: 3620DescriptionEveryyearthecowsholdaneventfeaturingapeculiarversionofhopscotchthatinvolvescarefullyjumpingfromrockto
u013068502
·
2015-05-13 19:00
poj
POJ 3258 River
Hopscotch
(二分搜索)
RiverHopscotchTimeLimit: 2000MS MemoryLimit: 65536KTotalSubmissions: 8422 Accepted: 3620DescriptionEveryyearthecowsholdaneventfeaturingapeculiarversionofhopscotchthatinvolvescarefullyjumpingfromrockto
lwt36
·
2015-05-13 17:00
Hopscotch
.(POJ-3050)
穷竭搜索。。无法剪枝。#include #include #include #include #include usingnamespacestd; inta[10][10]; charA[15]; intdx[]={0,1,0,-1}; intdy[]={1,0,-1,0}; setG; voiddfs(inti,intj,intcur){ if(cur==6){ A[6]='\0'; G.in
weizhuwyzc000
·
2015-04-16 16:00
ACM
poj
POJ 3050
Hopscotch
1.题目描述:点击打开链接2.解题思路:本题利用DFS解决。对每一个格子都进行dfs,当cur==6时,将合成的整数放入set中,最后输出set的大小即可。3.代码:#define_CRT_SECURE_NO_WARNINGS #include #include #include #include #include #include #include #include #include #incl
u014800748
·
2015-04-08 15:00
DFS
上一页
1
2
3
下一页
按字母分类:
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
其他