/******************************************************* * Copyright (C) 2015 Haotian Wu * * This file is the solution to the question: * https://www.hackerrank.com/challenges/floyd-city-of-blinding-lights * * Redistribution and use in source and binary forms are permitted. *******************************************************/ #include #include #include #include #include #include #include #include #include #include using namespace std; // Floyd Algorithm. Directed edges are used in this problem. int main() { int n,m; scanf("%d %d",&n,&m); int adj[401][401]; for (int i=1;i<=n;i++) for (int j=1;j<=n;j++) if (i == j) adj[i][j] = 0; else adj[i][j] = 10000000; for (int i=0;i