码迷,mamicode.com
首页 >  
搜索关键字:poj 3348 cows    ( 21218个结果
Heavy Transportation POJ - 1797
#include<string> #include <string.h> #include <stdio.h> #include <stdlib.h> #include <math.h> #include <algorithm> #include <queue> #include <vector> ...
分类:其他好文   时间:2020-02-14 11:08:50    阅读次数:66
POJ1038 Bugs Integrated, Inc. 状压dp(二进制做法)
题目网址:http://poj.org/problem?id=1038 题意:给出一张N*M的格子纸,其中有一些坏格子,问最多可以在格子纸上切下多少个2*3(3*2)的小矩阵(不包含坏格子)。其中N<=150, M<=10。 做法: 容易发现对于右端在第i列的小矩阵,其能否摆放只和i-1, i-2列 ...
分类:其他好文   时间:2020-02-13 18:47:46    阅读次数:72
POJ 1753 Flip Game
"POJ 1753 Flip Game" 题意 在一个4x4的棋盘上放有16枚一面黑一面白的棋子。 每次操作时,你可以选择一枚棋子,然后将这枚棋子以及它上下左右相邻的棋子(如果有的话)翻面(颜色反转)。 给定棋盘初始的样子,请问在一些操作后,是否可以将所有棋子都变成一个颜色?如果可以的话,最少需要多 ...
分类:其他好文   时间:2020-02-13 09:17:49    阅读次数:57
POJ 2185 Milking Grid--另一种字符串的循环节
在Power String中,求一个字符串的循环节,应满足L mod (L-next[L])=0,则循环节长度为L-next[L] 存在另一种形式的循环节,例如abcabca,此时如果将abc重写三次,得到abcabcabc,则原字符串为其前缀. 此时对于原字符串,其循环节长度为L-next[L]= ...
分类:其他好文   时间:2020-02-13 00:26:29    阅读次数:64
[LC] 299. Bulls and Cows
Example 1: Input: secret = "1807", guess = "7810" Output: "1A3B" Explanation: 1 bull and 3 cows. The bull is 8, the cows are 0, 1 and 7. Example 2: In ...
分类:其他好文   时间:2020-02-12 22:25:22    阅读次数:81
[Usaco2017 Open]Bovine Genomics
Farmer John owns Ncows with spots and N cows without spots. Having just completed a course in bovine genetics, he is convinced that the spots on his c ...
分类:其他好文   时间:2020-02-12 18:15:58    阅读次数:70
lost cows
这道题用树状数组做比较好,虽然树状数组能做的线段树也可以做到,但是树状数组更简洁方便,易操作 原理便是第x个数的二进制数最后一个“1”,决定tree的结点的长度 比如: sum[3]=tree[3]+tree[2]; sum[4]=tree[4]; sum[5]=tree[5]+tree[4]; 分 ...
分类:其他好文   时间:2020-02-12 13:15:00    阅读次数:42
Picture POJ - 1177 线段树+离散化+扫描线 求交叉图像周长
参考 https://www.cnblogs.com/null00/archive/2012/04/22/2464876.html #include <stdio.h> #include <algorithm> #define LEN 10000 using namespace std; struc ...
分类:其他好文   时间:2020-02-11 20:48:58    阅读次数:75
POJ 3352 Road Construction
#include<cstdio> #include<cstring> #include<cmath> #include<algorithm> #define maxn 1005 using namespace std; int num,to[maxn<<1],nxt[maxn<<1],last[ma ...
分类:其他好文   时间:2020-02-11 17:35:13    阅读次数:63
POJ百炼——1191棋盘分割
1191:棋盘分割 总时间限制:1000ms内存限制:65536kB描述将一个8*8的棋盘进行如下分割:将原棋盘割下一块矩形棋盘并使剩下部分也是矩形,再将剩下的部分继续如此分割,这样割了(n-1)次后,连同最后剩下的矩形棋盘共有n块矩形棋盘。(每次切割都只能沿着棋盘格子的边进行)原棋盘上每一格有一个 ...
分类:其他好文   时间:2020-02-11 11:19:11    阅读次数:61
21218条   上一页 1 ... 36 37 38 39 40 ... 2122 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!