結果

問題 No.369 足し間違い
ユーザー uafr_csuafr_cs
提出日時 2016-05-13 22:22:33
言語 Java21
(openjdk 21)
結果
AC  
実行時間 112 ms / 2,000 ms
コード長 1,409 bytes
コンパイル時間 2,550 ms
コンパイル使用メモリ 78,608 KB
実行使用メモリ 39,364 KB
最終ジャッジ日時 2024-04-15 16:31:20
合計ジャッジ時間 3,524 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 56 ms
36,876 KB
testcase_01 AC 56 ms
36,776 KB
testcase_02 AC 57 ms
36,964 KB
testcase_03 AC 57 ms
36,948 KB
testcase_04 AC 110 ms
39,168 KB
testcase_05 AC 68 ms
37,568 KB
testcase_06 AC 107 ms
38,924 KB
testcase_07 AC 112 ms
39,364 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.Closeable;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.Scanner;
import java.util.Set;
import java.util.StringTokenizer;
import java.util.TreeMap;

public class Main {
	
	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		
		final int N = sc.nextInt();
		int sum = 0;
		for(int i = 0; i < N; i++){
			sum += sc.nextInt();
		}
		
		System.out.println(sum - sc.nextInt());
	}
	
	public static class Scanner implements Closeable {
		private BufferedReader br;
		private StringTokenizer tok;
 
		public Scanner(InputStream is) throws IOException {
			br = new BufferedReader(new InputStreamReader(is));
		}
 
		private void getLine() throws IOException {
			while (!hasNext()) {
				tok = new StringTokenizer(br.readLine());
			}
		}
 
		private boolean hasNext() {
			return tok != null && tok.hasMoreTokens();
		}
 
		public String next() throws IOException {
			getLine();
			return tok.nextToken();
		}
 
		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}
 
		public long nextLong() throws IOException {
			return Long.parseLong(next());
		}
 
		public void close() throws IOException {
			br.close();
		}
	}
}
0