結果

問題 No.1081 和の和
ユーザー ks2mks2m
提出日時 2020-06-19 21:23:28
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 460 bytes
コンパイル時間 3,501 ms
コンパイル使用メモリ 71,352 KB
実行使用メモリ 56,192 KB
最終ジャッジ日時 2023-09-16 13:08:20
合計ジャッジ時間 4,696 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
55,436 KB
testcase_01 AC 121 ms
55,988 KB
testcase_02 AC 123 ms
55,956 KB
testcase_03 AC 127 ms
55,968 KB
testcase_04 WA -
testcase_05 AC 123 ms
55,832 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

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);
	}
}
0