码迷,mamicode.com
首页 >  
搜索关键字:cow    ( 1685个结果
POJ2018 Best Cow Fences 二分答案/DP
显然二分答案,然后减去对应的mid,求超过L的最大子段和验证就好了。 当然记录下长度的直接DP也是可以的。 然而二分答案怎么都WA,很好奇为什么 直接输出r反而是能过的。 看了下https://blog.csdn.net/jiangshibiao/article/details/21963437 想 ...
分类:其他好文   时间:2018-07-15 16:10:55    阅读次数:419
POJ3287(BFS水题)
Description Farmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts at a point N (0 ≤ N ≤ 100,00 ...
分类:其他好文   时间:2018-07-15 14:58:32    阅读次数:179
luogu P1821 Silver Cow Party
题目描述 One cow from each of N farms (1 ≤ N ≤ 1000) conveniently numbered 1..N is going to attend the big cow party to be held at farm #X (1 ≤ X ≤ N). A ...
分类:其他好文   时间:2018-07-14 16:46:21    阅读次数:185
题解 P2419 【[USACO08JAN]牛大赛Cow Contest】
看到许多大佬都用了拓补排序,本蒟蒻偏不用这么~~高级的~~算法,其实这道题目用dfs就可以过了。(ps:对本题解有疑惑的person可以向我留下评论) 思路: 我们先来考虑一下怎么样我们才可以确定一个牛的排名,我们如果假设赢了或间接赢了这个牛的牛数为sum_win,输了或间接输掉的牛数为sum_lo ...
分类:其他好文   时间:2018-07-12 19:58:15    阅读次数:114
Tallest Cow(线段树较易)
题目描述 FJ's N (1 ≤ N ≤ 10,000) cows conveniently indexed 1..N are standing in a line. Each cow has a positive integer height (which is a bit of secret). ...
分类:其他好文   时间:2018-07-11 21:24:24    阅读次数:152
POJ3278-Catch That Cow
大致题意: 给定两个整数n和k 通过 n+1或n-1 或n*2 这3种操作,使得n==k 输出最少的操作次数 解题思路: 三入口的BFS 注意的地方: 由于用于广搜的 队列数组 和 标记数组 相当大,如果定义这两个数组时把它们扔到局部去,编译是可以的,但肯定执行不了,提交就等RE吧= = 大数组必须 ...
分类:其他好文   时间:2018-07-11 20:40:09    阅读次数:110
POJ 3278 Catch That Cow
题意:给一个起点和终点,只有三种走法n+1, n-1, n*2, 求最短需要的步数 解题思路:BFS,用BFS解决无权图的最短路问题。 注:很容易re,我re了10多次,有两个点要注意 1.如果起始点s>=终点e那么,就只能回退,所以step=s-e 2.编号不可能出边界(0, MAXSIZE) ...
分类:其他好文   时间:2018-07-11 12:29:08    阅读次数:162
usaco16 jan gold
T1:angry cows Bessie the cow has designed what she thinks will be the next big hit video game: "Angry Cows". The premise, which she believes is comple ...
分类:其他好文   时间:2018-07-10 23:38:17    阅读次数:222
poj 3613 Cow Relays【矩阵快速幂+Floyd】
!:自环也算一条路径 矩阵快速幂,把矩阵乘法的部分替换成Floyd(只用一个点扩张),这样每“乘”一次,就是经过增加一条边的最短路,用矩阵快速幂优化,然后因为边数是100级别的,所以把点hash一下最多剩下200个 ...
分类:其他好文   时间:2018-07-06 23:23:25    阅读次数:176
P2947 [USACO09MAR]向右看齐Look Up
题目描述 Farmer John's N (1 <= N <= 100,000) cows, conveniently numbered 1..N, are once again standing in a row. Cow i has height H_i (1 <= H_i <= 1,000,0 ...
分类:其他好文   时间:2018-07-03 22:35:00    阅读次数:185
1685条   上一页 1 ... 36 37 38 39 40 ... 169 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!