This puzzle (click to submit solution to Timus Online Judge) is interesting.
It is like a IQ test question at the beginning. Find out the missing number. The puzzle asks you to find out any sequence that matches the overtuned number pattern. So the valid numbers are 0, 1, 6, 9, 8. Any others are invalid.
The sequence must be less than 100 (2 digit only) and obviously the maximum sequence is 88, 89, 90, 91 and there does not exist the sequence more than 5, but there might be other sequences of length 4, for example, 98, 99, 100, 101.
n = int(raw_input()) if n == 1: print "01" elif n == 2: print "11 01" elif n == 3: print "16 06 68" elif n == 4: print "16 06 68 88" else: print "Glupenky Pierre"
The 5 cases lead to the answer. You don’t need to bruteforce search at all.
–EOF (The Ultimate Computing & Technology Blog) —
GD Star Rating
loading...
223 wordsloading...
Last Post: Moving rot47.net to VPS finally (Website Migration)
Next Post: WordPress Themes Files Blocked by robots.txt Leading to Mobile Friendly Test Failure