結果

問題 No.111 あばばばば
ユーザー matsuyoshi30matsuyoshi30
提出日時 2016-02-05 20:22:21
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 356 bytes
コンパイル時間 1,977 ms
コンパイル使用メモリ 74,016 KB
実行使用メモリ 828,888 KB
最終ジャッジ日時 2023-10-21 19:18:56
合計ジャッジ時間 4,871 ms
ジャッジサーバーID
(参考情報)
judge11 / judge10
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 MLE -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

/*
L3 = 1
Ln = Ln-1 + n - 2
 */

import java.util.Scanner;

class Test {
	public static int aba(int n) {
		if(n == 3) {
			return 1;
		} else {
			return aba(n-1) + n - 2;
		}
	}

	public static void main(String[] args) throws Exception {
		Scanner in = new Scanner(System.in);
		int l = in.nextInt();

		int ans = aba(l);

		System.out.println(ans);
	}
}
0