Improved Code and removed Warnings (#483)

This commit is contained in:
Parth Shandilya
2018-10-19 14:00:31 +05:30
committed by GitHub
parent 07451a6ca4
commit 5d1f72604d
36 changed files with 67 additions and 67 deletions

View File

@@ -168,7 +168,7 @@ def topo(G, ind=None, Q=[1]):
def adjm():
n, a = input(), []
n, a = raw_input(), []
for i in xrange(n):
a.append(map(int, raw_input().split()))
return a, n

View File

@@ -1,10 +1,10 @@
from __future__ import print_function
num_nodes, num_edges = list(map(int,input().split()))
num_nodes, num_edges = list(map(int,raw_input().split()))
edges = []
for i in range(num_edges):
node1, node2, cost = list(map(int,input().split()))
node1, node2, cost = list(map(int,raw_input().split()))
edges.append((i,node1,node2,cost))
edges = sorted(edges, key=lambda edge: edge[3])

View File

@@ -1,12 +1,12 @@
from __future__ import print_function
# n - no of nodes, m - no of edges
n, m = list(map(int,input().split()))
n, m = list(map(int,raw_input().split()))
g = [[] for i in range(n)] #graph
r = [[] for i in range(n)] #reversed graph
# input graph data (edges)
for i in range(m):
u, v = list(map(int,input().split()))
u, v = list(map(int,raw_input().split()))
g[u].append(v)
r[v].append(u)