Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@lkraider
Last active July 21, 2017 01:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lkraider/9682d28afb942948e66be638bfe29bf0 to your computer and use it in GitHub Desktop.
Save lkraider/9682d28afb942948e66be638bfe29bf0 to your computer and use it in GitHub Desktop.
Square Matrix II
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
# https://www.urionlinejudge.com.br/judge/pt/problems/view/1478
from sys import stdout
w = stdout.write
m = ''.join('%03s ' % l for l in range(100, 0, -1) + range(2, 101))
n = input('')
while n > 0:
nn = n * 4
for ss in xrange(396, 396 - nn, -4):
w(m[ss: ss+nn-1] + '\n')
w('\n')
n = input('')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment