結果
| 問題 |
No.554 recurrence formula
|
| コンテスト | |
| ユーザー |
aaaaasatori
|
| 提出日時 | 2018-02-24 18:33:49 |
| 言語 | Java (openjdk 23) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 388 bytes |
| コンパイル時間 | 4,067 ms |
| コンパイル使用メモリ | 74,836 KB |
| 実行使用メモリ | 67,584 KB |
| 最終ジャッジ日時 | 2024-10-15 04:14:56 |
| 合計ジャッジ時間 | 11,239 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 1 WA * 18 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[i]);
}
}
}
aaaaasatori