Advertisement
T-D-K

Untitled

May 21st, 2018
339
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.96 KB | None | 0 0
  1. //p1
  2. m,n = map(int, input().split())
  3. s = 1
  4. for i in range(m):
  5.     r = input().split()
  6.     for j in range(n):
  7.         c = r[j]
  8.         if c[len(c) - 1] == '6':
  9.             s = s * int(c)
  10. print(s)
  11.  
  12. //p2
  13. m, n = map(int, input().split())
  14. for i in range(m):
  15.     r = list(map(int, input().split()))
  16.     m = 0
  17.     for j in range(n):
  18.         if r[j] > 0:
  19.             if m == 0:
  20.                 m = r[j]
  21.             else:
  22.                 m = min(r[j], m)
  23.     print(m)
  24.  
  25. //p3
  26. m, n = map(int, input().split())
  27. a = []
  28. for i in range(m):
  29.     a.append(list(map(int, input().split())))
  30. s = 0
  31. for j in range(n):
  32.     for i in range(m):
  33.         if a[i][j] != 7:
  34.             break
  35.     else:
  36.         s = s + 1
  37. print(s)
  38.  
  39. //p4
  40. m, n = map(int, input().split())
  41. a = 0
  42. ai = 0
  43. for i in range(n):
  44.     q = list(map(int, input().split()))
  45.     s = 0
  46.     for j in range(m):
  47.         s = s + q[j]
  48.     if s > a:
  49.         a = s
  50.         ai = i
  51. print(str(a)+" "+str(ai))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement