ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1225. Flags

pavlo.omelchenko How to solve it ? [2] // Problem 1225. Flags 5 Feb 2014 16:27
I'm newby here and I didn't solve this kind of tasks before.
I know, that must be very easy, give me please some pieces of advice to solve it.
Levon Oganesyan Re: How to solve it ? // Problem 1225. Flags 6 Feb 2014 05:51
Think abstractly! It's very easy!

Edited by author 06.02.2014 05:58

Edited by author 06.02.2014 05:58
morbidel Re: How to solve it ? // Problem 1225. Flags 6 Feb 2014 19:38
You can either take it the mathematical way, and solve it by induction: assume you know the number of ways for 1..N stripes, how to find out the ways for N+1?
Or you can make a brute-force algorithm (backtracking) that simply counts and prints the number of ways for each N between 1 and 10-20 (until it gets too slow), then try to deduce a general rule for N, based on this series.
Good luck!