結果

問題 No.44 DPなすごろく
ユーザー hhgfhn1
提出日時 2018-10-18 10:20:30
言語 Java
(openjdk 23)
結果
TLE  
実行時間 -
コード長 377 bytes
コンパイル時間 2,366 ms
コンパイル使用メモリ 74,020 KB
実行使用メモリ 61,044 KB
最終ジャッジ日時 2024-10-15 00:08:23
合計ジャッジ時間 12,251 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample -- * 4
other AC * 14 TLE * 1 -- * 5
権限があれば一括ダウンロードができます

ソースコード

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