2017-11-09
P3385 【模板】负环【DFS-SPFA】

题目描述 暴力枚举/SPFA/Bellman-ford/奇怪的贪心/超神搜索 输入输出格式 输入格式:第一行一个正整数T表示数据组数,对于每组数据: 第一行两个正整数N M,表示图有N个顶点,M条边 接下来M行,每行三个整数a b w,表示a->b有一条权值为w的边(若w<0则为单向,否则双向) 输出格式:共T行。对于每组数据,存在负环则输出一行"YE5"(不含引号),否则输出一行"N0"( …

阅读更多 →
代码
2016-05-18
poj3259:负环判定,SPFA

几天没有AC了..实在手痒啊,上题。 Wormholes Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 41416 Accepted: 15226 Description While exploring his many farms, Farmer John has discovered a number of amazing wormholes. A wormhole is very peculiar because it is a one-way path that delivers you to its destination at a time …

阅读更多 →
代码 学习
2016-04-20
poj1511:链式前向星+SPFA做法

做了两天..终于AC了.. Invitation Cards Description In the age of television, not many people attend theater performances. Antique Comedians of Malidinesia are aware of this fact. They want to propagate theater and, most of all, Antique Comedies. They have printed invitation cards with all the necessary information and with the programme. A …

阅读更多 →
学习
没有更多文章了...