結果
| 問題 |
No.143 豆
|
| ユーザー |
yoniha
|
| 提出日時 | 2024-10-02 21:12:07 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 4 ms / 1,000 ms |
| コード長 | 834 bytes |
| コンパイル時間 | 6,831 ms |
| コンパイル使用メモリ | 333,608 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-02 21:12:17 |
| 合計ジャッジ時間 | 7,560 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 17 |
ソースコード
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rrep(i, n) for(int i = (int)(n - 1); i >= 0; i--)
template <typename T> bool chmax(T &a,const T &b){if(a<b){a=b;return true;}return false;}
template <typename T> bool chmin(T &a,const T &b){if(a>b){a=b;return true;}return false;}
using ll = long long;
#define int ll
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vb = vector<bool>;
using vvb = vector<vector<bool>>;
using vs = vector<string>;
using pii = pair<int, int>;
// using mint = modint!!!number!!!;
signed main(){
int k, n, f; cin >> k >> n >> f;
int mame = k * n;
while(f--){
int a; cin >> a;
mame -= a;
}
cout << (mame < 0 ? -1 : mame) << endl;
}
yoniha