結果
| 問題 | No.44 DPなすごろく |
| ユーザー |
101000010
|
| 提出日時 | 2017-05-18 01:25:27 |
| 言語 | Java (openjdk 26.0.2.1 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 57 ms / 5,000 ms |
| + 130µs | |
| コード長 | 447 bytes |
| 記録 | |
| コンパイル時間 | 2,818 ms |
| コンパイル使用メモリ | 84,212 KB |
| 実行使用メモリ | 42,972 KB |
| 最終ジャッジ日時 | 2026-08-29 20:19:25 |
| 合計ジャッジ時間 | 5,012 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_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