单源最短路问题(SSSP)一共有三种算法:
Dijkstra:适用于正权图。时间复杂度 $O(nlogm)$。
Bellman-ford:适用于边数限制图。时间复杂度 $O(nm)$。
SPFA:适用于负权图,判断图上是否有环。最坏时间复杂度 $O(nm)$,一般时间复杂度 $O(m)$。
大家要根据题目要求正确选择算法。
注意:正权图尽量使用 Dijkstra。负权图使用 SPFA。
RunID | User | Nick Name | Problem ID | Result | Memory | Time | Language | Code Length | Submit Time |
47108 | zhangguanshun2009 | 张观顺 | Accepted | 8372 KiB | 0 ms | C++ | 1020 bytes | 2022-03-17 20:35:35 | |
47096 | xietengyi | 谢腾毅 | Accepted | 7648 KiB | 0 ms | C++ | 1177 bytes | 2022-03-16 20:57:53 | |
47046 | yczhou | 小周 | Accepted | 14064 KiB | 0 ms | C++ | 1074 bytes | 2022-03-15 20:07:43 | |
47045 | yczhou | 小周 | Accepted | 14064 KiB | 0 ms | C++ | 1074 bytes | 2022-03-15 20:07:28 | |
47043 | yczhou | 小周 | Accepted | 14064 KiB | 0 ms | C++ | 1074 bytes | 2022-03-15 20:06:27 | |
47042 | yczhou | 小周 | Accepted | 14064 KiB | 0 ms | C++ | 1074 bytes | 2022-03-15 20:05:35 | |
47040 | yczhou | 小周 | Accepted | 2464 KiB | 0 ms | C++ | 1273 bytes | 2022-03-15 20:00:29 | |
47031 | zhangguanshun2009 | 张观顺 | Accepted | 8372 KiB | 0 ms | C++ | 1020 bytes | 2022-03-15 18:24:49 | |
46932 | yczhou | 小周 | Accepted | 50716 KiB | 0 ms | C++ | 1153 bytes | 2022-03-13 21:20:55 | |
46925 | zhangguanshun2009 | 张观顺 | Accepted | 8372 KiB | 188 ms | C++ | 1020 bytes | 2022-03-13 20:31:28 | |
46923 | zhangguanshun2009 | 张观顺 | Runtime Error | 50560 KiB | 8 ms | C++ | 1132 bytes | 2022-03-13 20:29:52 | |
46922 | xietengyi | 谢腾毅 | Accepted | 6868 KiB | 0 ms | C++ | 1011 bytes | 2022-03-13 20:16:44 | |
46921 | zhangguanshun2009 | 张观顺 | Accepted | 8372 KiB | 0 ms | C++ | 1020 bytes | 2022-03-13 20:13:39 | |
46920 | xietengyi | 谢腾毅 | Accepted | 7648 KiB | 0 ms | C++ | 1177 bytes | 2022-03-13 20:13:08 | |
46919 | zhangguanshun2009 | 张观顺 | Compile Error | 0 KiB | 0 ms | C++ | 75 bytes | 2022-03-13 20:12:33 | |
46918 | xietengyi | 谢腾毅 | Accepted | 6868 KiB | 0 ms | C++ | 1011 bytes | 2022-03-13 19:56:42 | |
46911 | xietengyi | 谢腾毅 | Accepted | 2420 KiB | 0 ms | C++ | 728 bytes | 2022-03-13 19:20:47 | |
46910 | xietengyi | 谢腾毅 | Accepted | 4536 KiB | 0 ms | C++ | 1083 bytes | 2022-03-13 19:18:24 | |
46907 | xietengyi | 谢腾毅 | Accepted | 2244 KiB | 0 ms | C++ | 1317 bytes | 2022-03-13 19:16:11 | |
46906 | xietengyi | 谢腾毅 | Accepted | 9212 KiB | 0 ms | C++ | 1084 bytes | 2022-03-13 19:15:49 | |
46903 | xietengyi | 谢腾毅 | Accepted | 4536 KiB | 0 ms | C++ | 1075 bytes | 2022-03-13 19:13:26 | |
46901 | xietengyi | 谢腾毅 | Accepted | 4536 KiB | 0 ms | C++ | 1083 bytes | 2022-03-13 19:10:17 | |
46848 | cqh | 陈启航 | Accepted | 4856 KiB | 0 ms | C++ | 925 bytes | 2022-03-13 15:52:32 | |
46846 | cqh | 陈启航 | Accepted | 4072 KiB | 0 ms | C++ | 1232 bytes | 2022-03-13 15:46:53 | |
46844 | cqh | 陈启航 | Accepted | 2164 KiB | 0 ms | C++ | 1090 bytes | 2022-03-13 15:45:50 | |
46843 | cqh | 陈启航 | Wrong Answer | 2164 KiB | 0 ms | C++ | 1088 bytes | 2022-03-13 15:45:22 |