pihta24

Untitled

Dec 18th, 2020 (edited)
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.45 KB | None | 0 0
  1. def f(l_):
  2.     n = []
  3.     for q in l_:
  4.         if q not in n:
  5.             n.extend(q)
  6.     return n
  7.  
  8.  
  9. a = int(input())
  10. b = int(input())
  11. start = []
  12. for i in range(a):
  13.     start.append(input().split())
  14. cut = f(start)
  15. end = {}
  16. for i in cut:
  17.     cort1 = []
  18.     cort2 = []
  19.     for j in start:
  20.         if i in j:
  21.             cort1.append(start.index(j))
  22.             cort2.append(j.index(i))
  23.         end[i] = [tuple(cort1), tuple(cort2)]
  24. print(end)
  25.  
Add Comment
Please, Sign In to add comment