HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Contests > IMPC - 2013-2014 > problem:


14-03-70. 50468 - Draw Matrix - 2

IMPC - 2013-2014

Start: Mar.16.2013 at 12:00:00 PM
Finish: Mar.16.2013 at 05:00:00 PM
The contest is finished!
• Contest scoreboard

Contest problems

• 14-01-40. 50419 - The longest bitoni...
• 14-01-50. 50795 - Trunk
• 14-03-10. 50412 - K numbers
• 14-03-20. 50398 - Sum of kth Anti-d...
• 14-03-30. 50377 - kth Permutation
• 14-03-40. 50773 - Balanced Sum Tree
• 14-03-60. 50382 - Parkside's Other ...
• 14-03-70. 50468 - Draw Matrix - 2
• 14-03-70. 50468 - Draw Matrix - 2
• 14-03-80. 50675 - Kruja Boys
• 14-03-90. 50717 - Hurdle Jumping
• 14-04-20. 50493 - n-digit kth Prime ...
• 14-04-30. 50669 - Area of an Irregu...
• 14-04-40. 50712 - Moon algebra
• 14-04-50. 50697 - Base Stations
• 14-05-10. 50723 - Tribonacci
• 14-05-20. 50677 - The Cottage

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.
Question by Ibrahim Mesecan.

Draw Matrix - 2

Given an nxn matrix fill the matrix in such a way that the upper left corner is one. And that is surrounded by zeros. And the zeros are surrounded by ones again. This continues until the matrix size n.

Question: Write a program that is going to fill the matrix with ones and zeros starting from upper left corner.

Input specification
You will be given an integer number (n) the size of square matrix where 1 ≤ n ≤ 20.

Output specification
Show the square matrix with ones and zeros.

 Sample Input   
  4
 Sample Output   
  0 1 0 1
  0 1 0 0
  0 1 1 1
  0 0 0 0

Для отправки решений необходимо выполнить вход.

www.contester.ru