码迷,mamicode.com
首页 >  
搜索关键字:poj 2007 scrambled p    ( 20315个结果
Cable master (POJ No.1064)
二分搜索思想:bool C(double x)可以得到长度为x的绳子//#define LOCAL#include#includeint const MAX_N=10005;int const MAX_M=100;double const INF=100000000;int N,K;double d...
分类:其他好文   时间:2014-05-17 00:13:44    阅读次数:271
POJ 3156 - Interconnect (概率DP+hash)
题意:给一个图,有些点之间已经连边,现在给每对点之间加边的概率是相同的,问使得整个图连通,加边条数的期望是多少。此题可以用概率DP+并查集+hash来做。用dp(i,j,k...)表示当前的每个联通分量的点数分别是i,j,k...(连通分量的个数不固定)时,加边的期望。这样以dp(i,j,k)为例分...
分类:其他好文   时间:2014-05-16 06:23:26    阅读次数:312
POJ 3126 Prime Path SPFA
给你两个四位的素数s和t,要求每次改变一个数字,使得改变后的数字也为素数,求s变化到t的最少变化次数。...
分类:其他好文   时间:2014-05-15 05:38:25    阅读次数:234
POJ 1436 Horizontally Visible Segments(线段树建图+枚举)
题目连接:http://poj.org/problem?id=1436 题意:给一些线段,每个线段有三个值y1, y2, x代表起点为(x, y1),终点为(x, y2)的线段。当从一个线段可以作水平线到另一个线段并且不穿过其他线段时,就称这两个线段时水平可见的。当三个线段可以两两水平可见,就称为形成一个线段三角。问:在这些线段中有多少个这样的线段三角? 分析:可以把每条线段看做是一个点,如果...
分类:其他好文   时间:2014-05-14 15:27:25    阅读次数:282
POJ 1742
CoinsTime Limit:3000MSMemory Limit:30000KTotal Submissions:27580Accepted:9335DescriptionPeople in Silverland use coins.They have coins of value A1,A2,...
分类:其他好文   时间:2014-05-14 11:52:46    阅读次数:270
poj 2417
1 Accepted 8508K 391MS C++ 2004B 2 相比下边,,优化太多太多了。。。 3 /** 4 baby-step-giant-step 因为数据量太大,,自己写hash 5 6 **/ 7 #include 8 #include...
分类:其他好文   时间:2014-05-13 19:27:32    阅读次数:363
POJ 3017 单调队列dp
Cut the Sequence Time Limit: 2000MS   Memory Limit: 131072K Total Submissions: 8764   Accepted: 2576 Description Given an integer sequence { an } of length N, you are to ...
分类:其他好文   时间:2014-05-13 16:04:29    阅读次数:267
POJ 2823 单调队列
Sliding Window Time Limit: 12000MS   Memory Limit: 65536K Total Submissions: 36469   Accepted: 10803 Case Time Limit: 5000MS Description An array of size n ≤ 106 is gi...
分类:其他好文   时间:2014-05-13 15:36:47    阅读次数:357
POJ3067:Japan(线段树)
Description Japan plans to welcome the ACM ICPC World Finals and a lot of roads must be built for the venue. Japan is tall island with N cities on the East coast and M cities on the West coast (M <= ...
分类:其他好文   时间:2014-05-13 14:53:40    阅读次数:189
线段树-poj-2823
大意:给出数组a,内容为 a1 a2 a3 ... an。再给一个常数k。从i=1起,计算ai、a i+1、...、a i+k-1区间内的最小值和最大值。 线段树咯。...
分类:其他好文   时间:2014-05-13 14:11:41    阅读次数:187
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!