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