結果
| 問題 |
No.1081 和の和
|
| コンテスト | |
| ユーザー |
ks2m
|
| 提出日時 | 2020-06-19 21:23:28 |
| 言語 | Java (openjdk 23) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 460 bytes |
| コンパイル時間 | 1,954 ms |
| コンパイル使用メモリ | 74,324 KB |
| 実行使用メモリ | 54,504 KB |
| 最終ジャッジ日時 | 2024-07-03 13:38:32 |
| 合計ジャッジ時間 | 4,076 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 2 WA * 6 |
ソースコード
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];
}
a = b;
}
System.out.println(a[0] % 1000000007);
}
}
ks2m