题目地址:codeforces #pi (DIV2) E
题目很水。。就是先求两边最短路,然后把可能为最短路的边挑出来,然后判断是否yes只需要转化成无向图跑一遍tarjan,找出割边,割边就是yes,然后剩下的边就让它的值为最短路-1就行了,如果-1后变成了非正数,就是no.
但是!!!居然卡spfa!!那是不是说cf以后就不能用可以卡的算法了。。完全可以出组数据来卡这些算法。。。比如spfa...
分类:
其他好文 时间:
2015-08-07 20:19:51
阅读次数:
145
CodeForces 567E President and RoadsDescriptionBerland has n cities, the capital is located in city s, and the historic home town of the President is in city t (s?≠?t). The cities are connected by one-...
分类:
其他好文 时间:
2015-08-07 20:05:20
阅读次数:
144
#include#include#include#include#include#include#include#include#include#include#include#include#include#include#define ll long long#define REP(i,a,b)...
分类:
其他好文 时间:
2015-08-07 13:11:50
阅读次数:
87
A - How far away ?
Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d
& %I64u
Submit Status
Description
There are n houses in the village and some bidirectional roads...
分类:
其他好文 时间:
2015-08-06 00:33:07
阅读次数:
147
题意 你要从第1个城市到第N个城市去 有m条路 每条路用a, b, c, p, r 表示 你从第a个城市到第b个城市时 若之前经过或现在位于第c个城市 过路费就是p元 否则就是r元 求你到达第N个城市最少用多少过路费
由于最多只有10个城市 10条路 这个题就变得很简单了 直接暴力dfs就行 可以用状态压缩来存储已经走过了哪些城市 由于最多只有10条路 从某个城市...
分类:
其他好文 时间:
2015-08-03 16:55:29
阅读次数:
79
Constructing RoadsTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 16938Accepted Submission(s): 643...
分类:
其他好文 时间:
2015-08-03 16:30:33
阅读次数:
88
题目链接:http://poj.org/problem?id=2421想把n个村庄连接在一起;求最小生成树,不同的是已经有了m条线段链接在一起了,求剩下的;感觉用Kruskal会简单一点#include#include#include#include#include#include#define N...
分类:
其他好文 时间:
2015-07-27 18:25:19
阅读次数:
84
clc;close all;clear;road=shaperead('boston_roads.shp'); %读取shape文件figure,mapshow('boston.tif'); %读取tif遥感影像并显示axis image manual off; %关闭本地坐标系统surveyF.....
分类:
其他好文 时间:
2015-07-27 01:53:41
阅读次数:
367
Description
Angel was caught by the MOLIGPY! He was put in prison by Moligpy. The prison is described as a N * M (N, M <= 200) matrix. There are WALLs, ROADs, and GUARDs in the prison.Angel’s friends...
分类:
其他好文 时间:
2015-07-26 15:47:49
阅读次数:
86
题意:有一些村庄需要修一些道路是所有村庄都可以连接,不过有些道路已经修好了,问题最少还需要修建的道路长度是多少。输入的第一行是一个N代表N个村庄,下面是一个N*N的矩阵,代表着q->j的距离,然后输出一个Q,接着有Q行,表示AB已经修建的村庄分析:为了增加麻烦他们设定了一些已经修建的村庄,不过可以使...
分类:
其他好文 时间:
2015-07-24 22:06:23
阅读次数:
137