Skip to content

Instantly share code, notes, and snippets.

@autolyticus
Created March 16, 2019 17:52
Show Gist options
  • Select an option

  • Save autolyticus/c17dbe54290e7bd1b5bcff457988371c to your computer and use it in GitHub Desktop.

Select an option

Save autolyticus/c17dbe54290e7bd1b5bcff457988371c to your computer and use it in GitHub Desktop.
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2019 g <g@ABCL>
#
# Distributed under terms of the MIT license.
# 7 - 1
m = [[int(x) for x in input().split()] for i in range(int(input()))]
ut = [[m[i][j] if j >= i else 0 for j in range(len(m))] for i in range(len(m))]
for i in range(len(m)):
if i != 0:
print()
print(*ut[i], end='')
# 7 - 2
m = [[int(x) for x in input().split()] for i in range(int(input()))]
print('YES' if m == list(map(list, zip(*m))) else 'NO', end='')
# 7 - 3
n, m = [int(x) for x in input().split()]
for i in range(n):
if any(
map(lambda x: x != 0 and x != 1,
[int(x) for x in input().split()])):
print('NO', end='')
__import__('sys').exit()
print('YES', end='')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment