码迷,mamicode.com
首页 > 其他好文 > 详细

HDU 5241 Friends (大数)

时间:2017-04-29 22:17:10      阅读:144      评论:0      收藏:0      [点我收藏+]

标签:oid   math   tin   ann   eof   pre   void   nal   int   

题意:略。

析:答案就是32^n。

代码如下:

import java.math.BigInteger;
import java.util.Scanner;

public class Main{
	public static final int maxn = 3000 + 5;
	public static BigInteger []ans;
	
	public static void main(String[] args){
		Scanner cin = new Scanner(System.in);
		int T = cin.nextInt();
		ans = new BigInteger[maxn];
		ans[0] = BigInteger.ONE;
		for(int i = 1; i <= 3000; ++i)
			ans[i] = ans[i-1].multiply(BigInteger.valueOf(32));
		for(int kase = 1; kase <= T; ++kase){
			int n = cin.nextInt();
			System.out.println("Case #" + kase + ": " + ans[n]);
		}
	}
}

  

HDU 5241 Friends (大数)

标签:oid   math   tin   ann   eof   pre   void   nal   int   

原文地址:http://www.cnblogs.com/dwtfukgv/p/6786343.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!