結果
問題 |
No.143 豆
|
ユーザー |
|
提出日時 | 2017-06-19 16:09:32 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 293 bytes |
コンパイル時間 | 408 ms |
コンパイル使用メモリ | 56,208 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-23 10:46:22 |
合計ジャッジ時間 | 1,028 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 17 |
ソースコード
#include <iostream> #include <string> #include <algorithm> using namespace std; int main() { int k, n, f, a; cin >> k >> n >> f; int age=0; for(int i=0; i<f; i++){ cin >> a; age += a; } cout << (k*n < age ? -1 : k*n - age) << endl; return 0; }