SDUT 2763-fun to the power of the five (large number), sdut2763-large number

Source: Internet
Author: User

SDUT 2763-fun to the power of the five (large number), sdut2763-large number

Qudian fun Time Limit: 1000 ms Memory limit: 65536 K any questions? Click Here ^_^ Description

Here are some numbers for you to find a positive integer that is least present in these numbers. And obtain the fifth power of the number.

Enter n in the first line, which indicates n numbers. (N <1000000) the number of input n in the second row, each of which is less than 10000000000. Output

Output result

Sample Input
31 7 2
Sample output
243
Prepare to officially open java .. First release
Import java. io. *; import java. util. *; import java. math. *; public class Main {public static void main (String [] args) {role in = new role (System. in); int n, I; n = in. nextInt (); int [] a = new int [n]; for (I = 0; I <n; I ++) a [I] = in. nextInt (); Arrays. sort (a); for (I = 0; I <n-1; I ++) if (a [I + 1]-a [I]> 1) break; bigInteger ans = new BigInteger (Integer. toString (a [I] + 1); System. out. println (ans. pow (5 ));}}




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.