結果
問題 | No.9008 空白区切りで与えられる数値データの合計値を求める(テスト用) |
ユーザー | viral8 |
提出日時 | 2022-09-30 22:13:30 |
言語 | Java21 (openjdk 21) |
結果 |
AC
|
実行時間 | 68 ms / 2,000 ms |
コード長 | 1,374 bytes |
コンパイル時間 | 5,035 ms |
コンパイル使用メモリ | 73,032 KB |
実行使用メモリ | 51,640 KB |
最終ジャッジ日時 | 2023-08-24 15:46:49 |
合計ジャッジ時間 | 6,260 ms |
ジャッジサーバーID (参考情報) |
judge12 / judge15 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 41 ms
48,804 KB |
testcase_01 | AC | 41 ms
48,824 KB |
testcase_02 | AC | 41 ms
49,008 KB |
testcase_03 | AC | 41 ms
48,800 KB |
testcase_04 | AC | 40 ms
49,064 KB |
testcase_05 | AC | 41 ms
48,860 KB |
testcase_06 | AC | 42 ms
49,012 KB |
testcase_07 | AC | 53 ms
49,916 KB |
testcase_08 | AC | 62 ms
50,452 KB |
testcase_09 | AC | 59 ms
50,916 KB |
testcase_10 | AC | 65 ms
50,612 KB |
testcase_11 | AC | 65 ms
50,528 KB |
testcase_12 | AC | 65 ms
50,460 KB |
testcase_13 | AC | 65 ms
50,688 KB |
testcase_14 | AC | 65 ms
50,972 KB |
testcase_15 | AC | 66 ms
50,996 KB |
testcase_16 | AC | 68 ms
51,640 KB |
testcase_17 | AC | 41 ms
48,832 KB |
testcase_18 | AC | 40 ms
48,932 KB |
ソースコード
import java.io.*; class Main{ public static void main(String[] args)throws IOException{ SimpleScanner sc = new SimpleScanner(System.in); int N = sc.nextInt(); long answer = 0; while(N-->0){ answer += sc.nextLong(); } System.out.println(answer); } } /*//////////////////////////////////////////////// * My Scanner * @auther viral *///////////////////////////////////////////////// class SimpleScanner{ final private int buff_size = 1<<12; private InputStream is; private byte[] buff; private int point,length; public SimpleScanner(InputStream is){ this.is = is; buff = new byte[buff_size]; point = length = 0; } private void reload()throws IOException{ do{ length = is.read(buff,point = 0,buff_size); }while(length==-1); } private byte read()throws IOException{ if(point==length)reload(); return buff[point++]; } public int nextInt()throws IOException{ int ans = 0; byte c = read(); while(c<=' ')c = read(); boolean negate = c == '-'; if(c=='-')c = read(); while('0'<=c&&c<='9'){ ans = ans*10+c-'0'; c = read(); } return negate ? -ans : ans; } public long nextLong()throws IOException{ long ans = 0; byte c = read(); while(c<=' ')c = read(); boolean negate = c == '-'; if(c=='-')c = read(); while('0'<=c&&c<='9'){ ans = ans*10+c-'0'; c = read(); } return negate ? -ans : ans; } }