結果
| 問題 |
No.143 豆
|
| コンテスト | |
| ユーザー |
Knots
|
| 提出日時 | 2020-10-09 17:01:46 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 1,000 ms |
| コード長 | 440 bytes |
| コンパイル時間 | 1,747 ms |
| コンパイル使用メモリ | 191,100 KB |
| 最終ジャッジ日時 | 2025-01-15 03:41:20 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 17 |
ソースコード
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) for(int i=0;i<(n);++i)
#define COUT(x) cout<<(x)<<"\n"
int main(){
int k,n,f;
cin >> k >> n >> f;
int all=0;
REP(i,f){
int a;
cin >> a;
all += a;
}
if(all>k*n)COUT(-1);
else COUT(k*n-all);
}
Knots