You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

4 年之前
12345678910111213141516171819
  1. import sys
  2. grid = [line.split() for line in sys.stdin.readlines()]
  3. ans1 = 0
  4. for line in grid:
  5. a, b, c = sorted(map(int, line))
  6. ans1 += a + b > c
  7. print(ans1)
  8. ans2 = 0
  9. for col in zip(*grid):
  10. for line in zip(*[iter(col)] * 3):
  11. a, b, c = sorted(map(int, line))
  12. ans2 += a + b > c
  13. print(ans2)