結果

問題 No.369 足し間違い
ユーザー 37zigen37zigen
提出日時 2016-05-13 23:04:05
言語 Java21
(openjdk 21)
結果
AC  
実行時間 273 ms / 2,000 ms
コード長 369 bytes
コンパイル時間 2,455 ms
コンパイル使用メモリ 74,076 KB
実行使用メモリ 47,192 KB
最終ジャッジ日時 2024-04-15 16:51:02
合計ジャッジ時間 4,549 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 132 ms
41,276 KB
testcase_01 AC 134 ms
41,592 KB
testcase_02 AC 134 ms
41,020 KB
testcase_03 AC 139 ms
41,848 KB
testcase_04 AC 258 ms
46,988 KB
testcase_05 AC 200 ms
42,876 KB
testcase_06 AC 257 ms
46,316 KB
testcase_07 AC 273 ms
47,192 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicoder;
import java.util.Scanner;
public class Main{
	public static void main(String[] args){
		new Main().solve();
	}
	void solve(){
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int[] a=new int[n];
		long correct_sum=0;
		for(int i=0;i<n;i++)correct_sum+=sc.nextLong();
		long sum=sc.nextLong();
		System.out.println(-sum+correct_sum);
	}
}
0