結果
問題 | No.2835 Take and Flip |
ユーザー |
![]() |
提出日時 | 2024-08-09 22:29:37 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 317 ms / 2,000 ms |
コード長 | 516 bytes |
コンパイル時間 | 3,429 ms |
コンパイル使用メモリ | 74,364 KB |
実行使用メモリ | 58,788 KB |
最終ジャッジ日時 | 2024-08-09 22:29:48 |
合計ジャッジ時間 | 9,038 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 22 |
ソースコード
import java.io.BufferedReader; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); String[] sa = br.readLine().split(" "); int[] a = new int[n]; for (int i = 0; i < n; i++) { a[i] = Integer.parseInt(sa[i]); } br.close(); long ans = 0; for (int i = 0; i < n; i++) { ans += a[i]; } System.out.println(ans); } }