結果

問題 No.143 豆
ユーザー Sota
提出日時 2022-05-08 09:24:52
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 414 bytes
コンパイル時間 598 ms
コンパイル使用メモリ 67,968 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-07 19:54:50
合計ジャッジ時間 1,192 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>		//cin, cout
#include <vector>		//vector
#include <algorithm>	//sort,min,max,count
#include <string>		//string,getline, to_string

using namespace std;

int main() {

	int K, N, F;
	cin >> K >> N >> F;

	int ans = K * N;
	
	int temp;
	for (int i = 0; i < F; i++) {
		cin >> temp;
		ans = ans - temp;
	}

	if (ans >= 0) {
		cout << ans << endl;
	}
	else {
		cout << -1 << endl;
	}

	return 0;

}
0