結果

問題 No.53 悪の漸化式
ユーザー 👑tozangezan👑tozangezan
提出日時 2014-11-03 16:22:16
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 528 bytes
コンパイル時間 1,928 ms
コンパイル使用メモリ 71,800 KB
実行使用メモリ 56,772 KB
最終ジャッジ日時 2023-08-29 00:28:11
合計ジャッジ時間 5,478 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
56,276 KB
testcase_01 AC 122 ms
56,380 KB
testcase_02 AC 121 ms
55,852 KB
testcase_03 AC 121 ms
55,696 KB
testcase_04 AC 120 ms
55,596 KB
testcase_05 AC 120 ms
56,288 KB
testcase_06 AC 120 ms
56,280 KB
testcase_07 AC 120 ms
56,012 KB
testcase_08 AC 121 ms
55,888 KB
testcase_09 AC 120 ms
56,456 KB
testcase_10 AC 121 ms
56,240 KB
testcase_11 AC 120 ms
56,520 KB
testcase_12 AC 122 ms
56,360 KB
testcase_13 AC 124 ms
55,896 KB
testcase_14 AC 127 ms
56,460 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.math.*;
import java.util.*;
public class Main{
	public static void main(String args[]){
		Scanner s=new Scanner(System.in);
		int a=s.nextInt();
		BigDecimal A[]=new BigDecimal[110];
		A[0]=new BigDecimal("4");
		A[1]=new BigDecimal("3");
		for(int i=2;i<=a;i++){
			A[i]=(A[i-1].multiply(new BigDecimal("19")).subtract(A[i-2].multiply(new BigDecimal("12")))).divide(new BigDecimal("4"));
		}
		String ret=A[a].toString();
		if(ret.length()>80)ret=ret.substring(0,80);
		System.out.println(ret);
	}
}
0