結果

問題 No.220 世界のなんとか2
ユーザー kou6839kou6839
提出日時 2015-08-11 13:06:47
言語 Java21
(openjdk 21)
結果
TLE  
実行時間 -
コード長 320 bytes
コンパイル時間 2,058 ms
コンパイル使用メモリ 71,864 KB
実行使用メモリ 59,800 KB
最終ジャッジ日時 2023-09-25 08:06:39
合計ジャッジ時間 9,977 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
59,800 KB
testcase_01 AC 126 ms
55,852 KB
testcase_02 AC 126 ms
55,548 KB
testcase_03 AC 128 ms
56,016 KB
testcase_04 AC 126 ms
55,448 KB
testcase_05 AC 127 ms
55,852 KB
testcase_06 AC 129 ms
55,792 KB
testcase_07 AC 126 ms
55,936 KB
testcase_08 AC 127 ms
55,976 KB
testcase_09 AC 131 ms
55,740 KB
testcase_10 AC 133 ms
55,544 KB
testcase_11 AC 131 ms
55,452 KB
testcase_12 AC 137 ms
55,768 KB
testcase_13 AC 152 ms
55,508 KB
testcase_14 AC 188 ms
55,744 KB
testcase_15 AC 315 ms
55,776 KB
testcase_16 AC 643 ms
55,620 KB
testcase_17 TLE -
testcase_18 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
public class Main {
	static long cul(long p){
		if(p==1){
			return 3;
		}
		return cul(p-1)*3+(cul(p-1)+1)*3+(cul(p-1)+2)*3+((long)Math.pow(10, p-1)-1);
	}
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long P = sc.nextLong();
		System.out.println(cul(P));
	}
}
0