Notice: Undefined index: AOJ_user_id in /home/judge/src/web/JudgeOnline/problem.php on line 27

Notice: Undefined offset: 0 in /home/judge/src/web/JudgeOnline/problem.php on line 28

Notice: Trying to access array offset on value of type null in /home/judge/src/web/JudgeOnline/problem.php on line 29

Notice: Trying to access array offset on value of type null in /home/judge/src/web/JudgeOnline/problem.php on line 30

Notice: Trying to access array offset on value of type null in /home/judge/src/web/JudgeOnline/problem.php on line 31

Notice: Trying to access array offset on value of type null in /home/judge/src/web/JudgeOnline/problem.php on line 32

Notice: Undefined offset: 0 in /home/judge/src/web/JudgeOnline/problem.php on line 35

Notice: Trying to access array offset on value of type null in /home/judge/src/web/JudgeOnline/problem.php on line 36

Notice: Undefined offset: 0 in /home/judge/src/web/JudgeOnline/problem.php on line 40

Notice: Trying to access array offset on value of type null in /home/judge/src/web/JudgeOnline/problem.php on line 41

Notice: Trying to access array offset on value of type null in /home/judge/src/web/JudgeOnline/problem.php on line 42

Notice: Trying to access array offset on value of type null in /home/judge/src/web/JudgeOnline/problem.php on line 43

Notice: Trying to access array offset on value of type null in /home/judge/src/web/JudgeOnline/problem.php on line 44

Notice: Undefined offset: 0 in /home/judge/src/web/JudgeOnline/problem.php on line 48

Notice: Trying to access array offset on value of type null in /home/judge/src/web/JudgeOnline/problem.php on line 49

Notice: Undefined offset: 0 in /home/judge/src/web/JudgeOnline/problem.php on line 53

Notice: Trying to access array offset on value of type null in /home/judge/src/web/JudgeOnline/problem.php on line 54

Notice: Trying to access array offset on value of type null in /home/judge/src/web/JudgeOnline/problem.php on line 55

Notice: Trying to access array offset on value of type null in /home/judge/src/web/JudgeOnline/problem.php on line 56

Notice: Undefined offset: 0 in /home/judge/src/web/JudgeOnline/problem.php on line 59

Notice: Trying to access array offset on value of type null in /home/judge/src/web/JudgeOnline/problem.php on line 60

Notice: Undefined offset: 0 in /home/judge/src/web/JudgeOnline/problem.php on line 65

Notice: Trying to access array offset on value of type null in /home/judge/src/web/JudgeOnline/problem.php on line 66

Notice: Trying to access array offset on value of type null in /home/judge/src/web/JudgeOnline/problem.php on line 67

Notice: Trying to access array offset on value of type null in /home/judge/src/web/JudgeOnline/problem.php on line 68

Notice: Undefined offset: 0 in /home/judge/src/web/JudgeOnline/problem.php on line 71

Notice: Trying to access array offset on value of type null in /home/judge/src/web/JudgeOnline/problem.php on line 72
3196:判断负环
Problem 3196 --判断负环

3196: 判断负环

"
Time Limit $1$ 秒/Second(s) Memory Limit $512$ 兆字节/Megabyte(s)
提交总数 $0$ 正确数量 $0$
裁判形式 标准裁判/Standard Judge 我的状态 尚未尝试
难度 分类标签
给出一张 n (n<=100)个点,m 条边的有向图,请判断这张图中是否存在负环。如果有,输出Yes,否则输出No。有T组(T<=20)组数据 
一个数 T ,表示数据组数
以后每张图两个整数n, m,表示这种图的点数和边数
接下来 m 行,第 i 行三个数xi ,yi, zi,表示一条边xi yi,权值为 zi
T 行,第 i 行表示第 i 张图的答案
有负环输出Yes, 否则输出 No
2
1 1
1 1 -1
4 4
1 2 1
2 1 1
3 4 -2
4 3 1
Yes
Yes
spfa算法

推荐代码 查看3196 所有题解 上传题解视频得图灵币

本题记录 用 户(点击查看用户) 运行号(点击购买题解) 时 间
算法最快[$ $ms]
内存最少[$ $KB]
第一AC
第一挑战

赛题来源/所属竞赛 最短路径算法 N/A

竞赛编号 竞赛名称 竞赛时间 访问比赛
AOJ