結果
| 問題 | No.1081 和の和 |
| コンテスト | |
| ユーザー |
ks2m
|
| 提出日時 | 2020-06-19 21:24:28 |
| 言語 | Java (openjdk 25.0.2) |
| 結果 |
AC
|
| 実行時間 | 66 ms / 2,000 ms |
| コード長 | 484 bytes |
| 記録 | |
| コンパイル時間 | 3,073 ms |
| コンパイル使用メモリ | 81,256 KB |
| 実行使用メモリ | 42,592 KB |
| 最終ジャッジ日時 | 2026-03-24 21:55:35 |
| 合計ジャッジ時間 | 2,954 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 8 |
ソースコード
import java.util.Scanner;
public class Main {
public static void main(String[] args) throws Exception {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
long[] a = new long[n];
for (int i = 0; i < n; i++) {
a[i] = sc.nextLong();
}
sc.close();
for (int i = n - 1; i > 0; i--) {
long[] b = new long[n];
for (int j = 0; j < i; j++) {
b[j] = a[j] + a[j + 1];
b[j] %= 1000000007;
}
a = b;
}
System.out.println(a[0] % 1000000007);
}
}
ks2m