結果
問題 | No.143 豆 |
ユーザー |
![]() |
提出日時 | 2017-01-29 01:51:19 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 309 bytes |
コンパイル時間 | 503 ms |
コンパイル使用メモリ | 56,688 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-23 10:40:03 |
合計ジャッジ時間 | 1,097 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 17 |
ソースコード
#include <iostream> #include <algorithm> #include <string> using namespace std; int main() { int k, n, f, sum=0, ans=0; int a[101]; cin >> k >> n >> f; for(int i=0;i<f;i++){ cin >> a[i]; sum += a[i]; } if(k*n >= sum){ ans = k*n - sum; }else{ ans = -1; } cout << ans << endl; return 0; }