結果
| 問題 |
No.554 recurrence formula
|
| コンテスト | |
| ユーザー |
aaaaasatori
|
| 提出日時 | 2018-02-24 18:34:28 |
| 言語 | Java (openjdk 23) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 387 bytes |
| コンパイル時間 | 3,361 ms |
| コンパイル使用メモリ | 74,512 KB |
| 実行使用メモリ | 61,616 KB |
| 最終ジャッジ日時 | 2024-10-15 04:15:56 |
| 合計ジャッジ時間 | 10,069 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 19 TLE * 1 -- * 1 |
ソースコード
import java.util.Scanner;
public class No554 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
final long mod = 1000000007;
int n = sc.nextInt();
long a[] = new long[n+1];
a[0] = 0;
a[1] = 1;
for(int i = 2;i <= n;i++) {
for(int j = 1;j < i;j += 2) {
a[i] += i * a[i-j] % mod;
}
a[i] %= mod;
}
System.out.println(a[n]);
}
}
aaaaasatori