結果
問題 |
No.1081 和の和
|
ユーザー |
![]() |
提出日時 | 2025-09-08 11:35:15 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 625 bytes |
コンパイル時間 | 3,045 ms |
コンパイル使用メモリ | 77,468 KB |
実行使用メモリ | 46,764 KB |
最終ジャッジ日時 | 2025-09-08 11:35:21 |
合計ジャッジ時間 | 5,148 ms |
ジャッジサーバーID (参考情報) |
judge / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 2 WA * 6 |
ソースコード
import java.util.*; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int n = scan.nextInt(); List<Long> list = new ArrayList<Long>(); for(int i = 0 ; i < n ; i++){ list.add(scan.nextLong()); } while(list.size() > 1){ List<Long> listCopy = new ArrayList<Long>(); for(int i = 0 ; i < list.size()-1 ; i++){ listCopy.add(list.get(i) + list.get(i+1)); } list = listCopy; } long remainder = 1000000007; System.out.println(list.get(0) % remainder); } }