
各种OJ------poj
文章平均质量分 89
Miaowey
即使是无尽的黑夜包围了我,依愿眸子里满是星光。
while(true) ++rp;
展开
-
poj 1637 Sightseeing tour 混合欧拉图判定
POJ - 1637点我点我:-)Sightseeing tourTime Limit: 1000MS Memory Limit: 10000KB 64bit IO Format: %lld & %lluSubmitStatus DescriptionThe city executive board in原创 2016-10-15 21:18:52 · 390 阅读 · 0 评论 -
判断生成树的唯一性 poj1679 The Unique MST
【分析】最小生成树的唯一性,思路是先判断每条边是否有重边,有的话eq=1,否则0.然后第一次求出最小生成树,将结果记录下来, 然后依次去掉第一次使用过的且含有重边的边,再求一次最小生成树,若结果与第一次结果一样,则不唯一。#include#include#include#include#include#includeusing namespace std;str原创 2016-08-27 23:12:44 · 744 阅读 · 0 评论 -
poj 2831 Can We Build This One?
POJ - 2831Can We Build This One?Time Limit: 5000MS Memory Limit: 65536KB 64bit IO Format: %lld & %lluSubmitStatus Description“Highways are built, then l原创 2016-08-30 20:50:55 · 484 阅读 · 0 评论 -
poj 3255
POJ - 3255点我点我:-)RoadblocksTime Limit: 2000MS Memory Limit: 65536KB 64bit IO Format: %lld & %lluSubmitStatus DescriptionBessie has moved to a small fa原创 2016-09-01 23:26:08 · 277 阅读 · 0 评论 -
POJ3463 求次短路径条数
POJ - 3463点我点我:-)SightseeingTime Limit: 2000MS Memory Limit: 65536KB 64bit IO Format: %lld & %lluSubmitStatus DescriptionTour operator Your Person原创 2016-09-03 16:30:33 · 397 阅读 · 0 评论 -
poj 2449 Remmarguts' Date(最短路+A*)
POJ - 2449点我点我:-)Remmarguts' DateTime Limit: 4000MS Memory Limit: 65536KB 64bit IO Format: %lld & %lluSubmitStatus Description"Good man never make原创 2016-09-04 16:27:26 · 377 阅读 · 0 评论 -
poj 3612 神奇的DP
Telephone WireTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 3198 Accepted: 1119DescriptionFarmer John's cows are getting restless about their poor t原创 2016-09-16 18:35:48 · 403 阅读 · 0 评论 -
欧拉函数 & poj2047
欧拉函数是指:对于一个正整数n,小于n且和n互质的正整数(包括1)的个数,记作φ(n) 。通式:φ(x)=x*(1-1/p1)*(1-1/p2)*(1-1/p3)*(1-1/p4)…..(1-1/pn),其中p1, p2……pn为x的所有质因数,x是不为0的整数。φ(1)=1(唯一和1互质的数就是1本身)。对于质数p,φ(p) = p - 1。注意φ(1)=1.欧拉定理:对于互质的正整原创 2016-09-25 14:48:20 · 438 阅读 · 0 评论 -
poj 3613 Cow Relays
题目大意: 给出一张无向连通图,求S到E经过k条边的最短路。POJ - 3613点我点我:-)Cow RelaysTime Limit: 1000MS Memory Limit: 65536KB 64bit IO Format: %lld & %lluSubmitStatus Descripti原创 2016-10-10 19:54:34 · 300 阅读 · 3 评论 -
poj__3145(配套总结本)
Harmony ForeverTime Limit: 10000MS Memory Limit: 65536KTotal Submissions: 5834 Accepted: 1414DescriptionWe believe that every inhabitant of this universe eventual原创 2016-12-15 18:08:14 · 363 阅读 · 0 评论 -
poj 2331
(IDA*: 即为A*算法加上迭代加深搜索,本题为IDA*)DescriptionThe Eastowner city is perpetually haunted with water supply shortages, so in order to remedy this problem a new water-pipe has been built. Builders原创 2016-08-27 21:19:30 · 527 阅读 · 0 评论 -
poj 1155 TELE
POJ - 1155点我点我:-)TELETime Limit: 1000MS Memory Limit: 65536KB 64bit IO Format: %lld & %lluSubmitStatus DescriptionA TV-network plans to broadcast an impor原创 2016-09-03 22:52:12 · 278 阅读 · 0 评论 -
poj 2914 最小割 Stoer-Wagner 算法
POJ - 2914点我点我Minimum CutTime Limit: 10000MS Memory Limit: 65536KB 64bit IO Format: %lld & %lluSubmitStatus DescriptionGiven an undirected graph, in whi原创 2016-10-14 20:17:18 · 400 阅读 · 3 评论 -
poj 3164 Command Network
题目大意:给定一个有向图,根节点已知,求该有向图的最小树形图。最小树形图即有向图的最小生成树,定义为:选择一些边,使得根节点能够到达图中所有的节点,并使得选出的边的边权和最小。题目算法:朱-刘算法(即由中国人朱永津和刘振宏共同发明的算法)。算法步骤如下:(本文不再证明,参考下面给出的我自己画的一个图即可理解)1.判断图的连通性,若不连通直接无解,否则一定有解。2.为原创 2016-10-13 21:20:07 · 268 阅读 · 0 评论 -
POJ - 2989 All Friends 极大团
POJ - 2989点我点我All FriendsTime Limit: 1000MS Memory Limit: 65536KB 64bit IO Format: %lld & %lluSubmitStatus DescriptionSociologists are interested in the p原创 2016-10-12 21:45:32 · 1511 阅读 · 0 评论 -
poj 3621
POJ - 3621点我点我:-)Sightseeing CowsTime Limit: 1000MS Memory Limit: 65536KB 64bit IO Format: %lld & %lluSubmitStatus DescriptionFarmer John has decided原创 2016-10-10 21:28:30 · 336 阅读 · 0 评论 -
POJ - 2584(二分匹配入门)
POJ - 2584点我点我:-)T-Shirt GumboTime Limit: 1000MS Memory Limit: 65536KB 64bit IO Format: %lld & %lluSubmitStatus DescriptionBoudreaux and Thibodeaux are stud原创 2016-10-03 23:03:42 · 499 阅读 · 0 评论 -
poj 1019 (数学计算)
POJ - 1019点我点我:-)大致题意:有一串数字串,其规律为1 12 123 1234 12345 123456 1234567 12345678 123456789 12345678910 1234567891011 123456789101112······k输入位置n,计算这一串数字第n位是什么数字,注意是数字,不是数!例如12345678910的第10位是原创 2016-09-21 21:36:19 · 472 阅读 · 0 评论 -
啊啊啊求c(n,k)
poj 1306 Combinations 下面给出两种方法^-^(都AC!!!)#include#include#include#include#include#includeusing namespace std;#define For(i, a, b) for(int i = a; i <= b; i++)#define ULL原创 2016-09-22 22:32:45 · 572 阅读 · 0 评论 -
poj 1131 (小数)十进制转八进制
POJ - 1131Octal FractionsTime Limit: 1000MS Memory Limit: 10000KB 64bit IO Format: %lld & %lluSubmitStatus DescriptionFractions in octal (base 8) notation原创 2016-09-19 19:57:37 · 1368 阅读 · 0 评论 -
POJ - 2135 Farm Tour
POJ - 2135点我点我:-)Farm TourTime Limit: 1000MS Memory Limit: 65536KB 64bit IO Format: %lld & %lluSubmitStatus DescriptionWhen FJ's friends visit him on the原创 2016-10-04 12:50:54 · 321 阅读 · 0 评论 -
POJ 1198 Solitaire(bfs)
Solitaire is a game played on a chessboard 8x8. The rows and columns of the chessboard are numbered from 1 to 8, from the top to the bottom and from left to right respectively.There are four ide原创 2016-08-27 21:08:29 · 525 阅读 · 0 评论