結果

問題 No.44 DPなすごろく
ユーザー hhgfhn1hhgfhn1
提出日時 2018-10-18 10:20:30
言語 Java21
(openjdk 21)
結果
TLE  
実行時間 -
コード長 377 bytes
コンパイル時間 2,779 ms
コンパイル使用メモリ 74,860 KB
実行使用メモリ 46,208 KB
最終ジャッジ日時 2024-04-23 00:56:34
合計ジャッジ時間 11,066 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 112 ms
41,308 KB
testcase_01 AC 110 ms
41,296 KB
testcase_02 AC 636 ms
41,448 KB
testcase_03 AC 124 ms
41,576 KB
testcase_04 AC 114 ms
41,412 KB
testcase_05 AC 241 ms
41,300 KB
testcase_06 AC 119 ms
41,592 KB
testcase_07 AC 109 ms
40,056 KB
testcase_08 AC 125 ms
41,584 KB
testcase_09 AC 111 ms
41,632 KB
testcase_10 AC 232 ms
41,264 KB
testcase_11 AC 101 ms
41,460 KB
testcase_12 AC 115 ms
41,168 KB
testcase_13 AC 110 ms
41,288 KB
testcase_14 TLE -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {

	@SuppressWarnings("resource")
	public static void main(String args[]) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		dfs(0,n);
		System.out.println(cnt);
	}

	static long cnt=0;
	private static void dfs(int i,int n) {
		if(i>=n){
			if(i==n)cnt++;
			return;
		}
		dfs(i+1,n);
		dfs(i+2,n);
		
	}
}
0