HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Sections > Ad-Hoc > problem:


50322 - Snake Pattern

Guest
• Review clarifications (1)

Section problems

• 50520 - Filling a Matrix Randomly
• 50454 - What day is it?
• 50474 - Sum of Two Primes
• 50597 - Drawing Diamonds
• 50253 - Timer
• 50294 - Centimeters to Yards
• 50303 - Pattern
• 50882 - FizzBuzz
• 50322 - Snake Pattern
• 50302 - Paper Scissors Rock
• 50396 - Cinema Tickets - 1
• 50366 - Student Averages (2 Grades)
• 50357 - Convert Euros into Dollars
• 50466 - Drawing Square From Stars
• 50351 - Convert inches to cm
• 50356 - Hours Passed
• 50350 - Fahrenheit to Celsius

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.
Prepared by Halil Karimis.

Snake Pattern

Andy is addicted to the snake game. So he wants to make a pattern that resembles a snake does when it moves.

You are asked to create the following pattern in a NxN grid;

Input specification
An integer number N.

Output specification
The pattern without any space

Sample Input I
3
Sample Input II
5
Sample Input III
8
Sample Output I
..S
SSS
S..
Sample Output II
....S
SSSSS
S....
SSSSS
....S
Sample Output III
.......S
SSSSSSSS
S.......
SSSSSSSS
.......S
SSSSSSSS
S.......
SSSSSSSS


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

www.contester.ru