結果
問題 | No.143 豆 |
ユーザー |
|
提出日時 | 2018-06-16 16:16:31 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 331 bytes |
コンパイル時間 | 487 ms |
コンパイル使用メモリ | 58,284 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-23 11:00:42 |
合計ジャッジ時間 | 1,061 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 17 |
ソースコード
#include <iostream>#include <vector>int main() {int k, n, f;std::cin>>k>>n>>f;int a=0;for(int i =0; i<f; ++i) {int _a;std::cin>>_a;a += _a;}int kn = k*n;if(kn < a) {std::cout<< -1 <<std::endl;return 0;}std::cout<<(kn - a)<<std::endl;}