码迷,mamicode.com
首页 >  
搜索关键字:poj 3348 cows    ( 21218个结果
最小生成树,POJ和HDU几道题目的解题报告(基于自己写的模板)
最小生成树解题报告,基于Prim算法
分类:其他好文   时间:2014-05-23 11:35:16    阅读次数:501
Poj 1112 Rebuilding Roads(树形DP+背包)
题意:给你由N个点构成一颗树,问要孤立出一个有P个节点的子树最少需要删除多少条边。N的范围最大为150N的范围不大,很容易想到在树上面做背包。把每个节点都看成一个背包,然后把每个儿子节点都看成是一组物品。为什么是一组呢,那是因为假设以儿子为根的节点的子树有S个节点,那么就有S+1种情况,要么将这整棵...
分类:其他好文   时间:2014-05-23 10:05:26    阅读次数:276
poj 3125 Printer Queue (队列)
?? Printer Queue Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 3679   Accepted: 1975 Description The only printer in the computer science students' union is...
分类:其他好文   时间:2014-05-23 08:05:45    阅读次数:273
poj 2082 Terrible Sets (数据结构 ——栈 STL)
?? Terrible Sets Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 2999   Accepted: 1549 Description Let N be the set of all natural numbers {0 , 1 , 2 , . . . ...
分类:其他好文   时间:2014-05-22 09:52:10    阅读次数:283
POJ 2773 Happy 2006
POJ 2773 Happy 2006 题目大意: 给定m,k,问你第K个与m互质的数是多少? 其中 m (1 <= m <= 1000000), K (1 <= K <= 100000000). 解题思路: 用位运算的容斥原理,计算 [1,x]与m互质的数的方法是: 假设 m的质因数为 a,b,c ,那么与m不互斥的数个数为 f(a)+f(b)+f(c)-f(ab)-f(ac)-fa(bc)+f(abc),f(t)的含义是 (1,x)有多少个数与t不互质,很明显f(t)=x/t,那么与m互...
分类:移动开发   时间:2014-05-20 13:50:30    阅读次数:291
Poj 1276 Cash Machine
Cash MachineTime Limit:1000MSMemory Limit:10000KTotal Submissions:26172Accepted:9238DescriptionA Bank plans to install a machine for cash withdrawal. ...
分类:其他好文   时间:2014-05-20 10:55:48    阅读次数:270
poj 3164 Command Network
http://poj.org/problem?id=3164第一次做最小树形图,看着别人的博客写,还没弄懂具体的什么意思。 1 #include 2 #include 3 #include 4 #include 5 #define maxn 1000 6 using namesp...
分类:Web程序   时间:2014-05-20 09:39:34    阅读次数:324
poj_1018_多种方法求解
Communication SystemTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 22445Accepted: 7977DescriptionWe have received an order from Pizoor Comm....
分类:其他好文   时间:2014-05-20 07:37:17    阅读次数:454
poj-2612
题意:输入一个n,然后输入两个n*n矩阵,一个代表雷的矩阵,一个代表走过的的矩阵。然后输出结果矩阵、解题思路:结果矩阵分两种情况,一个是没有踩到雷的,一个是踩到雷的,踩到雷的要把雷都显示出来。其实就是用结构体的二维数组存的两个矩阵,然后输入,判断即可。具体代码:#include#include#in...
分类:其他好文   时间:2014-05-19 13:41:19    阅读次数:220
poj 3177 Redundant Paths
DescriptionIn order to get from one of the F (1 2 and 1 –> 6 –> 5 –> 21 – 4: 1 –> 2 –> 3 –> 4 and 1 –> 6 –> 5 –> 43 – 7: 3 –> 4 –> 7 and 3 –> 2 –> 5 ....
分类:其他好文   时间:2014-05-19 12:43:06    阅读次数:200
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!