結果
問題 | No.143 豆 |
ユーザー |
|
提出日時 | 2015-11-29 22:27:40 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 279 bytes |
コンパイル時間 | 490 ms |
コンパイル使用メモリ | 55,300 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-23 10:23:44 |
合計ジャッジ時間 | 1,113 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 17 |
ソースコード
#include <iostream>using namespace std;int main(){ios::sync_with_stdio(false);int k, n, f, input, result;cin >> k >> n >> f;result=k*n;for(int i=0; i<f; ++i){cin >> input;result-=input;}cout << ((result<0) ? -1 : result) << "\n";return 0;}