結果

問題 No.143 豆
ユーザー ken
提出日時 2018-03-13 20:17:04
言語 C
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 266 bytes
コンパイル時間 124 ms
コンパイル使用メモリ 28,416 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-11-23 15:15:08
合計ジャッジ時間 843 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 3 WA * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<stdio.h>
int main(void){
	int k, n, f, a[100], i, sum, age;
	scanf("%d%d%d", &k, &n, &f);
	sum = k * n;
	for(i = 0 ; i < f ; i++){
		scanf("%d", &a[i]);
		age += a[i];
	}
	if(sum < age){
		printf("%d", -1);
	}else{
		printf("%d", sum - age);
	}
	return 0;
}
0