結果
問題 | No.143 豆 |
ユーザー |
![]() |
提出日時 | 2015-03-05 20:36:36 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 390 bytes |
コンパイル時間 | 516 ms |
コンパイル使用メモリ | 63,788 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-23 10:16:42 |
合計ジャッジ時間 | 1,148 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 17 |
ソースコード
#include <stdio.h> #include <iostream> #include <math.h> #include <vector> #include <algorithm> int main() { int k, n, f; int i; int ans; int t1; int total = 0; std::cin >> k >> n >> f; for(i = 0; i < f; i++) { std::cin >> t1; total += t1; } ans = k * n; ans -= total; if(ans < 0) { ans = -1; } std::cout << ans << std::endl; return 0; }