結果

問題 No.9009 改行区切りで与えられる数値データの合計値を求める(テスト用)
ユーザー viral8viral8
提出日時 2022-09-30 21:48:18
言語 Java21
(openjdk 21)
結果
AC  
実行時間 71 ms / 3,000 ms
コード長 1,374 bytes
コンパイル時間 2,040 ms
コンパイル使用メモリ 73,620 KB
実行使用メモリ 50,980 KB
最終ジャッジ日時 2023-08-24 15:17:42
合計ジャッジ時間 4,794 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 44 ms
48,768 KB
testcase_01 AC 41 ms
48,940 KB
testcase_02 AC 41 ms
48,972 KB
testcase_03 AC 42 ms
48,884 KB
testcase_04 AC 42 ms
48,892 KB
testcase_05 AC 42 ms
48,980 KB
testcase_06 AC 43 ms
49,028 KB
testcase_07 AC 53 ms
49,976 KB
testcase_08 AC 63 ms
50,504 KB
testcase_09 AC 70 ms
50,032 KB
testcase_10 AC 71 ms
50,912 KB
testcase_11 AC 68 ms
50,908 KB
testcase_12 AC 70 ms
50,980 KB
testcase_13 AC 68 ms
50,336 KB
testcase_14 AC 67 ms
50,712 KB
testcase_15 AC 67 ms
50,568 KB
testcase_16 AC 68 ms
50,916 KB
testcase_17 AC 41 ms
48,908 KB
testcase_18 AC 41 ms
48,836 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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