結果
| 問題 | No.44 DPなすごろく |
| ユーザー |
101000010
|
| 提出日時 | 2017-05-18 01:25:27 |
| 言語 | Java (openjdk 25.0.2) |
| 結果 |
AC
|
| 実行時間 | 56 ms / 5,000 ms |
| コード長 | 447 bytes |
| 記録 | |
| コンパイル時間 | 2,401 ms |
| コンパイル使用メモリ | 82,172 KB |
| 実行使用メモリ | 41,468 KB |
| 最終ジャッジ日時 | 2026-04-06 11:16:49 |
| 合計ジャッジ時間 | 4,498 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 20 |
ソースコード
import java.util.Scanner;
public class No44 {
public static void main(String[] args){
int N;
Scanner sc = new Scanner(System.in);
N = sc.nextInt();
long[] combination = new long[N+1];
combination[0] = 1;
combination[1] = 1;
for(int i=2; i<N+1; i++){
combination[i] = combination[i-1] + combination[i-2];
}
System.out.println(combination[N]);
}
}
101000010