結果

問題 No.143 豆
ユーザー zzzhikky
提出日時 2016-12-23 14:23:25
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 569 bytes
コンパイル時間 443 ms
コンパイル使用メモリ 55,784 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-12-14 16:53:22
合計ジャッジ時間 1,148 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 16 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

//============================================================================
// Name        : yuki143.cpp
// Author      :
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
using namespace std;

int main() {
	int k, n, f;
	cin >> k >> n >> f;
	int i, tmp, sum=0;
	for(i=0; i<f; ++i) {
		cin >> tmp;
		sum += tmp;
	}
	if(k*n - sum > 0) {
		cout << k*n - sum << endl;
	}else {
		cout << -1 << endl;
	}
	return 0;
}
0