結果

問題 No.143 豆
ユーザー ki_ki33ki_ki33
提出日時 2015-02-05 23:27:06
言語 Java21
(openjdk 21)
結果
AC  
実行時間 134 ms / 1,000 ms
コード長 1,276 bytes
コンパイル時間 2,628 ms
コンパイル使用メモリ 75,784 KB
実行使用メモリ 56,360 KB
最終ジャッジ日時 2023-09-30 16:28:58
合計ジャッジ時間 6,349 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
55,508 KB
testcase_01 AC 130 ms
55,848 KB
testcase_02 AC 128 ms
56,000 KB
testcase_03 AC 128 ms
55,912 KB
testcase_04 AC 129 ms
56,044 KB
testcase_05 AC 126 ms
55,660 KB
testcase_06 AC 130 ms
56,360 KB
testcase_07 AC 130 ms
55,888 KB
testcase_08 AC 128 ms
55,700 KB
testcase_09 AC 133 ms
55,896 KB
testcase_10 AC 134 ms
55,508 KB
testcase_11 AC 128 ms
55,796 KB
testcase_12 AC 129 ms
55,728 KB
testcase_13 AC 133 ms
55,764 KB
testcase_14 AC 133 ms
55,504 KB
testcase_15 AC 132 ms
55,768 KB
testcase_16 AC 124 ms
55,440 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedInputStream;
import java.io.IOException;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.*;
import java.util.Map.Entry;
import java.util.concurrent.ConcurrentSkipListSet;

public class Main {
	public static final int C =  1000000007;
	static final int CY = 1000000000;
	//static boolean MAP[][];
	static int K;
	static int N;
	static int F;
	static String S;
	static int M;
	static int MAX = -1;
	//static int tic[][];
	static int T[][];
	static int Y[];
	static double W[];
	//static int max;
	static long DP[];
	static int ST[][];
	//static int p[];
	//static ArrayList<HashSet<Integer>> al;
	static ConcurrentSkipListSet<Integer> TS;
	static ArrayList<Integer> AL;
	//static int a[][];
	//static char[][] ch;
	//static ArrayList<HashMap<Long, Long>> al;
	//static String a[];
	//static String str;

	public static void main(String[] args) {
		StringBuilder sb = new StringBuilder();
		BufferedInputStream bs = new BufferedInputStream(System.in);
		Scanner sc = new Scanner(bs);



		K = sc.nextInt();
		N = sc.nextInt();
		F = sc.nextInt();

		int sum = 0;
		//int a[] = new int[F];
		for (int i=0; i <F; i++) {
			sum += sc.nextInt();
		}

		long ans = K*N - sum; 

		
		
		System.out.println(ans >= 0 ? ans: -1);

	}


}
0