結果

問題 No.143 豆
ユーザー yycoderyycoder
提出日時 2019-12-08 19:57:33
言語 C
(gcc 12.3.0)
結果
RE  
実行時間 -
コード長 312 bytes
コンパイル時間 111 ms
コンパイル使用メモリ 27,864 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-08-30 03:44:21
合計ジャッジ時間 2,842 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 0 ms
4,376 KB
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 AC 0 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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