Blue Bridge Cup-special palindrome number

Source: Internet
Author: User

Special palindrome number time limit: 1.0s memory limit: 512.0MBProblem Description 123321 is a very special number, it reads from the left and reads from the right are the same.
Enter a positive integer n, programming all such five-bit and six-bit decimal numbers to satisfy the sum of the numbers equal to N. Enter a line in the format that contains a positive integer n. The output format outputs an integer that satisfies the condition in order from small to large, with each integer occupying one row. Example input 52 sample output 899998
989989
998899 Data size and convention 1<=n<=54.

And the same as before.


AC Code:

#include <cstdio> #include <cstring> #include <algorithm>using namespace std;const int maxn = 2000;int PALIN[MAXN], num = 0;int is_palin (int n)    //Determine if the palindrome number {if (n<100000) {if (n/10000 = n%10) && (n/1000%10 = = n/ 10%10)) return 1;} Else{if ((n/100000 = = n%10) && (n/10000%10 = = n/10%10) && (n/1000%10 = n/100%10)) return 1;} return 0;} void init ()     //palindrome number dozen Table {for (int i=10000; i<=999999; i++) {if (Is_palin (i)) palin[num++] = i;}} int fun (int n)     



Blue Bridge Cup-special palindrome number

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.