結果
問題 |
No.143 豆
|
ユーザー |
|
提出日時 | 2022-05-27 08:29:31 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 1,000 ms |
コード長 | 523 bytes |
コンパイル時間 | 732 ms |
コンパイル使用メモリ | 75,468 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-20 15:11:09 |
合計ジャッジ時間 | 1,535 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 17 |
ソースコード
#include <iostream> #include <vector> #include <string> #include <algorithm> #include <cmath> #define rep(i,n) for(i=0; i<n; ++i) #define in(a) cin >> a #define out(a,b) cout << a << b using namespace std; using lint = long long; int main(void){ int i, j, n, m, k, cnt = 0; in(k); in(n); in(m); vector<int> f(m); rep(i,m) in(f[i]); int mame = k*n; int sum = 0; rep(i,m) sum+=f[i]; int ans = -1; mame-=sum; if(mame>=0) ans = mame; out(ans,endl); return 0; }