URAL 2031. Overturned Numbers (enumeration)

Source: Internet
Author: User
Tags time limit

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;
}



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.