2031. Overturned Numbers
Time limit:1.0 Second
Memory limit:64 MB
Little Pierre was surfing the Internet and came across a interesting puzzle:what is the number under the car? It took some time before Pierre solved the puzzle, but eventually he understood that there were overturned numbers 86, 88, The answer was the number 87, and the. Now Pierre wants to entertain he friends with similar puzzles. He wants to construct a sequence of n numbers such so its overturning produces a consecutive segment of the positive int Egers. Pierre intends to use one-digit integers supplemented with a leading zero and two-digit integers only. To avoid ambiguity, note this when the digits 0, 1, and 8 is overturned, they remain the same, the digits 6 and 9 are con Verted into each other, and the remaining digits become unreadable symbols.InputThe only line contains the number n of integers in a sequence (1≤n≤99).OutputIf there is no sequence of length n with the above property, output "Glupenky Pierre" ("Silly Pierre" in Russian). Otherwise, output any of such sequences. The numbers in the sequence should is separated with a space.Samples
input |
Output |
2 |
11 01 |
99
|
Glupenky Pierre
|
problem Author:Nikita Sivukhin
problem Source:Ural Regional School Programming Contest 2014
Parsing: The title requires a sequence of successive sequences after flipping, directly enumeration can be.
AC Code:
#include <bits/stdc++.h>
using namespace std;
int main () {
int n;
while (scanf ("%d", &n)! = EOF) {
if (n = = 1) puts ("Down");
else if (n = = 2) puts ("one-by-one");
else if (n = = 3) puts ("A.");
else if (n = = 4) puts ("to");
Else puts ("Glupenky Pierre");
return 0;
}