結果
| 問題 |
No.143 豆
|
| コンテスト | |
| ユーザー |
Cooh
|
| 提出日時 | 2019-06-02 18:51:23 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 1,000 ms |
| コード長 | 321 bytes |
| コンパイル時間 | 396 ms |
| コンパイル使用メモリ | 54,340 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-23 11:14:38 |
| 合計ジャッジ時間 | 1,053 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
| 外部呼び出し有り |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 17 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:23:15: warning: ignoring return value of ‘int system(const char*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
23 | system("pause");
| ~~~~~~^~~~~~~~~
ソースコード
#include<iostream>
#include<string>
using namespace std;
int main() {
int K, N, F;
cin >> K >> N >> F;
int A;
int sum = 0;
for (int i = 0;i < F;i++) {
cin >> A;
sum = sum + A;
}
int ans = (K*N) - sum;
if (ans < 0) {
cout << -1 << endl;
}
else {
cout << ans << endl;
}
system("pause");
return 0;
}
Cooh