BestCoder Round #13(前兩題)
這一次又只出了一題,第二題沒有分析好,竟然直接copy代碼,不過長見識了。。
第一題給了一些限制條件,自己沒有分析好,就去亂搞,結果各種不對,後來有讀題才發現。。暴力亂搞。。
題目:
Beautiful Palindrome Number
Time Limit: 3000/1500 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 657 Accepted Submission(s): 369
Problem Description
A positive integer x can represent as (a1a2…akak…a2a1)10 or (a1a2…ak?1akak?1…a2a1)10 of a 10-based notational system, we always call x is a Palindrome Number. If it satisfies 0, we call x is a Beautiful Palindrome Number.
Now, we want to know how many Beautiful Palindrome Numbers are between 1 and 10N.
Input
The first line in the input file is an integer T(1≤T≤7), indicating the number of test cases.
Then T lines follow, each line represent an integer N(0≤N≤6).
Output
For each test case, output the number of Beautiful Palindrome Number.
Sample Input
2
1
6
Sample Output
9
258
Statistic | Submit | Clarifications | Back
代碼:
#include
#include
#include
#include
#include