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
cow
广搜:Catch That
Cow
CatchThatCowTimeLimit:4000/2000ms(Java/Other) MemoryLimit:131072/65536K(Java/Other)TotalSubmission(s):57 AcceptedSubmission(s):35ProblemDescriptionFarmerJohnhasbeeninformedofthelocationofafugitive
lethic
·
2012-08-18 11:00
HDOJ 2717 Catch That
Cow
(BFS)
http://acm.hdu.edu.cn/showproblem.php?pid=2717题意:从N到K有3中走法:坐标加1、减1、乘2。求从N到K的最短步数。思路:BFS#include #include #include usingnamespacestd; intn,k,cnt[111111]; voidbfs() { queueq; q.push(n); cnt[n]=0; whil
sdc1992
·
2012-08-16 10:00
poj3268 - Silver
Cow
Party
想看更多的解题报告:http://blog.csdn.net/wangjian8006/article/details/7870410 转载请注明出处:http://blog.csdn.net/wangjian8006题目大意:给出n个点和m条边,接着是m条边
wangjian8006
·
2012-08-16 10:00
c
POJ 3270
Cow
Sorting(置换循环节)
转载请注明出处,谢谢 http://blog.csdn.net/ACM_cxlove?viewmode=contents by---cxlove题目:有一串数字,要将它排列成升序,每次可以交换两个数,交换一次的代价为两数之和。要求代价最小。http://poj.org/problem?id=3270 经典的置换题目,黑书中有详细介绍。将原有数列排序之后,得到目标串,这样就与原串形
ACM_cxlove
·
2012-08-14 11:00
ini
sorting
POJ 1990 MooFest(树状数组)
id=1990题意:X轴上有N头牛(1 #include #include usingnamespacestd; constintmaxn=20010; structnode{ intx,v; }
cow
michaelalan
·
2012-08-11 22:00
c
struct
Bone Collector 2602 01背包问题
inTeddy’shometowntherewasamanwhowascalled“BoneCollector”.Thismanliketocollectvariesofbones,suchasdog’s,
cow
No_Retreats
·
2012-08-11 18:00
#pragma data_seg()
一般用在dll中,dll的地址空间可以被多个进程同时映射,当进程加载时候把dll的地址空间映射到该进程的私有虚拟空间中,当所有的数据段只是用来读的时候,这些数据在内存中时一份,win2000以后采用的
COW
xiesiyuana
·
2012-08-10 19:00
dll
微软
编译器
linker
#pragma data_seg()
一般用在dll中,dll的地址空间可以被多个进程同时映射,当进程加载时候把dll的地址空间映射到该进程的私有虚拟空间中,当所有的数据段只是用来读的时候,这些数据在内存中时一份,win2000以后采用的
COW
xie376450483
·
2012-08-10 19:00
杭电OJ2602--------Bone Collector---------01背包
inTeddy’shometowntherewasamanwhowascalled“BoneCollector”.Thismanliketocollectvariesofbones,suchasdog’s,
cow
zzukun
·
2012-08-10 15:00
优化
Integer
less
input
each
output
poj Catch That
Cow
(Bfs)
CatchThatCowTimeLimit:4000/2000ms(Java/Other) MemoryLimit:131072/65536K(Java/Other)TotalSubmission(s):25 AcceptedSubmission(s):9ProblemDescriptionFarmerJohnhasbeeninformedofthelocationofafugitivec
Wiking__acm
·
2012-08-10 12:00
c
input
output
Unix环境高级编程学习笔记(五) 进程控制
但这在许多情况下会不必要的耗费很多资源,所以现在的实现一般都采用了一种叫做“copy-on-write(
COW
)”的技术。在这种技术下,父进程和子进程会共享这
justaipanda
·
2012-08-08 22:00
编程
unix
user
Path
Terminal
Signal
POJ 3278 Catch That
Cow
bfs
来源:http://poj.org/problem?id=3278题意:给一个开始点和一个结束点,求从开始点到结束点需要多少步。可以左走一步,右走一步,或者坐标乘2.思路:裸的bfs啊,水题一枚。代码:#include #include #include #include usingnamespacestd; #defineCLR(arr,val)memset(arr,val,sizeof(ar
wmn_wmn
·
2012-08-06 19:00
Poj 3256
Cow
Picnic
题意:FJ的k头牛在n个牧场吃草,任意两个牧场之间可能有一条单向路径联通,共有m条,希望求出有多少牧场有可能让所有的牛都能到达。InputLine1:Threespace-separatedintegers,respectively: K, N,and M Lines2..K+1:Line i+1containsasingleinteger(1..N)whichisthenumberofthepa
paradiserparadiser
·
2012-08-06 18:00
Integer
Graph
input
Path
each
output
HDU 2838
cow
sorting 树状数组
话说这道题要用的三个树状数组,不容易啊。我刚开始想的时候想明白了用公式怎么算,却想不出来怎么转化到树状数组上,总感觉有些地方实现不了,原来竟然是用三个树状数组。。。这让只写过一个树状数组的孩纸情何以堪? 具体来说,有一个num数组,里面记录的是插入a[i]后,在a[i]之前插入且比a[i]小的数的个数;还有一个totalsum数组,记录的是插入第i个数后,前i-1个数的总和;还有一
sky_fighting
·
2012-08-06 16:00
Integer
input
each
Exchange
output
sorting
[置顶] 判断一文件是不是字符设备文件
试着在bash中输入以下行:$EXCLAIM=cowabunga$echo${EXCLAIM:0:3}
cow
$echo${EXCLAIM:3:7}abunga这种形式的字符串截断非常简便,只需用冒号分开来指定起始字
qustdjx
·
2012-08-04 11:00
File
bash
input
扩展
FP
n2
lvm 逻辑卷的快照及备份 还原
LVM采用写时复制技术(Copy-On-Write,
COW
),不用停止服务或将逻辑卷设为只读就可以进行备份,使用LVM快照功能既可以获得一致备份,又不会影响服务器的可用性。
浮生θ谨记
·
2012-08-02 22:00
快照
lvm快照
HDU 2602 Bone Collector
inTeddy’shometowntherewasamanwhowascalled“BoneCollector”.Thismanliketocollectvariesofbones,suchasdog’s,
cow
ultimater
·
2012-07-27 16:00
HDU-2717-Catch That
Cow
HDU-2717-CatchThatCowhttp://acm.hdu.edu.cn/showproblem.php?pid=2717基本的BFS,朝3个方向搜索即可#include #include #include #include #include usingnamespacestd; intn,k; charvisit[100005]; structnode { intx; inttime
Cambridgeacm
·
2012-07-25 08:00
struct
Go
copy on write
linux内核在使用fork创建进程时,基本上会使用Copy-On-Write(
COW
)技术。这里解释一下
COW
技术以及为什么在fork中使用。
bruno231
·
2012-07-25 03:00
function
idea
resources
磁盘
linux内核
Pointers
Linux写时拷贝技术(copy-on-write)
源于网上资料
COW
技术初窥:在Linux程序中,fork()会产生一个和父进程完全相同的子进程,但子进程在此后多会exec系统调用,出于效率考虑,linux中引入了“写时复制“技术,也就是只有进程空间的各段的内容要发生变化时
华山大师兄
·
2012-07-20 20:00
USACO2.4
Cow
Tours(cowtour)
第二章我最后做的这个题,一个最短路的题,输入邻接矩阵,先dfs计算牧场数量,然后对每一个牧场用floyd算法求牧区相互之间的最短路,并将牧区k中到所有牧区到牧区i的最大距离保存为da[k][i],以便后面的距离比较,然后任意选择两个牧场k、kk,每个牧场选一个牧区i、j,cal(i,j)是两牧区连线距离,da[k][i]、da[kk][j]是牧场k/kk的牧区到牧区i/j的最大距离
jzzlee
·
2012-07-04 13:00
USACO
POJ 3613
Cow
Relays floyd + 快速幂
本题的大意就是问从S到T经过边得个数恰为k的最短路是多少。参考国家队集训论文08年的 矩阵乘法在信息学中的应用01邻接矩阵A的K次方C=A^K,C[i][j]表示i点到j点正好经过K条边的路径数 对应于这道题,对邻接图进行K次floyd之后,C[i][j]就是点i到j正好经过K条边的最短路但是K次floyd难免复杂度太高了。所以可以使用快速幂的方法,二分的往上求解#include #include
sdj222555
·
2012-06-25 21:00
c
USACO 2.3
Cow
Pedigrees(nocows)
一棵k层的二叉树,含有n个结点,每个结点可能有0或者2个孩子,求所有可能的二叉树结构数对9901取余的结果。刚开始想到动态规划,但是没想出好的动态转移方程,后来想搜索,复杂度太高。无奈看了结题报告。 dp[i][j]表示i个结点可以组成的不超过j层的不同二叉树的数量。一共i个结点,除了根结点,还有i-1个结点,左子树m个结点,右子树i-1-m个结点,左子树不超过j-1
jzzlee
·
2012-06-25 15:00
USACO
Ruby编程语言学习笔记2
如果一行代码的第一个非空白的字符是一个"句点",那么这一行将被作为上一行的延续 animals=Array.new .push( " dog ") .push( "
cow
·
2012-06-06 16:00
Ruby
Poj 2184
Cow
Exhibition (DP_背包)
题目链接:http://poj.org/problem?id=2184题目大意:给定n头牛,每头有属性智商和幽默感,这两个属性值有正有负,现在要从这n头牛中选出若干头使得他们的智商和与幽默感和不为负数,并且两者两家和最大,如果无解输出0,n #include #defineMIN110 #defineMAX210000 #defineINF1000000000 #definemax(a,b)(a)
woshi250hua
·
2012-06-05 10:00
测试
java.util.ConcurrentModificationException错误的原因及解决方法
这里想到之前做过用java面向对象的方法来做,结果iterator遍历list的时候遇到一个问题:java.util.ConcurrentModificationException后来找到原因:定义两个类:farm,
cow
gwj879
·
2012-05-31 12:00
拓展JQuery函数库,开发JQuery 插件
_
cow
_vaginal()的形式调用了 1.第一种方法(模版),总觉得这种写法不太正统 (function($){ $.fn.extend({
当时我就震惊了
·
2012-05-26 14:00
JavaScript
function
extend
fn
hdu 2838
Cow
Sorting
题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=2838题目大意:有n头(1 #include #include #include #include #include #include #include #include #include #include #include #include #include usingnamespacestd;
gotoac
·
2012-05-10 00:00
c
struct
query
sorting
POJ 3278 Catch That
Cow
题目大概意思:从一点n到一点k可以向左一步一步移动也可以向右一步一步移动,也可以当在点x处时,一次移动到x*2处;求花费最少时间一开始我也不知道为什么是广搜画个图吧 要是全部都画出来就太大了,由这个图可以看出来,51020191817这条路是最短的,17所在的层数减1就是花费的最少的时间按照x-1 x+1 x*2 的顺序进行广搜最先到达k的层数就是最短的时间代码:#in
chaojiaini
·
2012-05-07 20:00
poj 3276 The
Cow
Lexicon
好蛋疼啊!今天被人完爆了!/* *Author:stormdpzh *POj:3276TheCowLexicon *Time:2012/4/2919:14:12 */ #include #include #include #include #include #include #include #include #include #include #include #definesz(v)((in
stormdpzh
·
2012-04-29 21:00
std::string 的两种实现方式
COW
(copy on wirte): 是当前主流的实现,不过在多线程环境下会有性能问题 参考: How is std::string implemented?
HEXLee
·
2012-04-21 22:00
String
POJ-2112 Floyd+二分枚举+最大流(or 匈牙利)
跑了Floyd将所有machine与
cow
的边提出来...排个
kk303
·
2012-04-21 09:00
c
OO
ini
USACO 4.2 The Perfect Stall网络流解最大二分图匹配
如下图所示方式构图,每条边的容量为1,则从source到sink最大流量就等于
cow
与stall的最大匹配代码:#include #include #defineMAX410 usingnamespacestd
sunny606
·
2012-04-19 16:00
网络
table
Path
layer
poj 3167
Cow
Patterns (字符串__KMP好题)
题目链接:http://poj.org/problem?id=3167题目大意:给你一个数字序列arr,再给一个数字序列brr,arr和brr中的数字都是1到s(s #include #defineMAX100010 #defineMIN30000 intn,m,s,smalli,smallj,equi,equj; inttot,pos[MAX],next[MIN];//匹配到的位置和总数和模
woshi250hua
·
2012-04-16 10:00
算法
测试
poj3278 - Catch That
Cow
想看更多的解题报告:http://blog.csdn.net/wangjian8006/article/details/7870410 转载请注明出处:http://blog.csdn.net/wangjian8006 题目大意: 输入两
wangjian8006
·
2012-04-14 13:00
js六种数据类型和var
如:“The
cow
jumped over the moon.” 数值数据类型:JavaScript 支持整数和浮点
ywwan2
·
2012-04-13 14:00
数据类型
usaco:
Cow
Pedigrees
dp原理:(1)dp[i][j]表示i个节点建 #include #include #include #include #defineIN"nocows.in" #defineOUT"nocows.out" #defineM205 #defineMOD9901 usingnamespacestd; intdp[M][M]; intn,k; voidsolve() { for(inti=1;i
stormdpzh
·
2012-04-09 21:00
POJ 3278 Catch That
Cow
思路很直接也很简单的一个bfs,但必须反思一下自己的是竟然在写bfs忘了修改visited,导致了tle,尼玛之前申请了visited的数组竟然没有用!写bfs时会很习惯的申请bfs,但却没有习惯的去使用,好吧,该死!该tle!/* POJ:3278CatchThatCow */ #include #include #include #include usingnamespacestd; co
stormdpzh
·
2012-04-04 13:00
struct
POJ 1989 The
Cow
Lineup [dp]
题意:给定一串长度=n,数字大小 #include #include #include #defineMax(a,b)((a)>(b)?(a):(b)) #defineMin(a,b)((a)<(b)?(a):(b)) usingnamespacestd; constintN=100005,M=10005; constintinf=(1<<30); intn,m; inta[N]; boolvis
wuyanyi
·
2012-04-03 12:00
POJ 2184
Cow
Exhibition [dp 背包]
题意:给定两串数字,有正有服,求出最大和,且这个和的状态下满足任一边都不为负。思路:dp。说是背包,但是其实完全不懂背包的也可以做出来。本质就是用dp数组来记录状态,然后依次增加状态和更新而已。。值得注意的就是对负值平移成非负的。linux环境下vim编辑器a掉的第二道题,很艰难,没少gdb。强烈意识到要开始改装一下vim成ide了,利其器。#include #include #include #
wuyanyi
·
2012-03-27 21:00
POJ1189 HDU271 The
Cow
Lineup
对于给定的序列和k,如例子所示进行划分{1,5,3,2,5,1,3,4}{4,2,5,1,2,3}{}其中第一和第二个子序列可以完全覆盖[1,k],所以对于任何长度是1或者2序列都可以构成。但是由于第三个子序列不完整不能完全覆盖[1,k](长度是0也是不完整),故长度是3的序列不能构成/********************************************************
neofung
·
2012-03-26 19:00
poj 3615
Cow
Hurdles
赤裸裸的floyd,思路很直接。很容易想到。/* POJ:3615CowHurdles */ #include #include #include #include #include #defineMaxN305 #defineMaxD(1<<20) usingnamespacestd; longmap[MaxN][MaxN]; intn,m,t; voidsolve() { for(in
stormdpzh
·
2012-03-25 18:00
c
poj 3614 Sunscreen
include #include #include #defineMaxLC2505 usingnamespacestd; structCow{ intminn,maxx; booloperator=
cow
stormdpzh
·
2012-03-25 18:00
c
struct
POJ
Cow
Sorting 置换
题意:每只牛都有一个脾气值,即所谓“牛脾气”。FarmerJohn's想把他的N头牛排序,按脾气升。他每次可以交换任意两头牛,由于脾气越大越麻烦,每次交换的麻烦程度就是两头牛的脾气之和。求出排好序的最小麻烦程度。题解:刘汝佳黄亮书,P247-248。先确定置换。每个k阶置换都可以化成k个对换之积。#include #include #include usingnamespacestd; #defi
Tsaid
·
2012-03-21 18:00
POJ-3274(hash结构)(Gold Balanced Lineup )
大概意思就是:数组sum[i][j]表示从第1到第i头
cow
属性j的出现次数。所以题目要求等价为:求满足sum[i][0]-sum[j][0]=sum[i][1]-sum[j][1]=.....
famousDT
·
2012-03-20 17:00
c
struct
null
POJ-3278(bfs定界和标记)(Catch That
Cow
)
【题目描述】给出a和b,a通过操作+1;-1;*2;至少几步能够到达b。【解题思路】首先要想到用bfs要点1:有个搜索上界就是b*2;要点2:对访问过的点要标记,避免重复搜索。structmy { intx,ans; }wo; intflag[1000005]; intmain() { inta,b; while(scanf("%d%d",&a,&b)==2){ queueq; memset(fl
famousDT
·
2012-03-19 13:00
struct
F - Catch That
Cow
F-CatchThatCowTimeLimit:2000MSMemoryLimit:65536KB64bitIOFormat:%I64d&%I64uSubmitStatusPracticePOJ3278DescriptionFarmerJohnhasbeeninformedofthelocationofafugitivecowandwantstocatchherimmediately.Hestar
CSUST_ACM
·
2012-03-16 15:25
搜索专题
poj 3660
Cow
Contest ----floyd 传递闭包
/* 和poj1975(求其可能为中间那个不)有点像,此题也是先floyd, 然后求比他小的和比他大的数量是否为n-1,是则他的位置可以确定 保证(guaranteed)所给数据不冲突 */ #include #include intg[101][101];//g[i][j]表示j比i若 voidfloyd(intn) { inti,j,k; for(k=1;k<=n;k++) for(i=1;
qq172108805
·
2012-03-15 20:00
重做catch the
cow
1.思路果然清晰了,十分钟搞定#include #include #include #include usingnamespacestd; intn,k; queueq; intstep[100010]; intbfs(inta) { if(a==k) returnstep[k]; else { if(a-1>=0&&step[a-1]==0) { step[a-1]=step[a]+1;
dollarzhaole
·
2012-03-12 20:00
poj 2018 Best
Cow
Fences 二分查找dp
看了网上别人的结题报告才写出来的惭愧参考bloghttp://blog.acmj1991.com/?p=919和http://www.cppblog.com/varg-vikernes/archive/2010/03/02/108737.aspx #include usingnamespacestd; #definedoit(n)for(inti=1;i-1e-6)//注意这里为负值0的时候
youngyangyang04
·
2012-03-10 13:00
2010
上一页
48
49
50
51
52
53
54
55
下一页
按字母分类:
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
其他