You can find spfa.cpp in the attachment.
QOJ.ac
QOJ
			Time Limit:
			1 s		
				Memory Limit:
			512 MB		
				Total points:
			100		
									
#3839. Shortest Path Fast Algorithm
统计
			This problem is prepared by 
quailty			.
		
You can find spfa.cpp in the attachment.