結果
| 問題 |
No.143 豆
|
| コンテスト | |
| ユーザー |
rhyoo
|
| 提出日時 | 2020-02-18 15:50:07 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 422 bytes |
| コンパイル時間 | 570 ms |
| コンパイル使用メモリ | 66,224 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-23 11:25:25 |
| 合計ジャッジ時間 | 1,226 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 17 |
ソースコード
#include <iostream>
#include <stdio.h>
#include <vector>
#define rep(i,n) for(int i = 0; i < n; i++)
typedef long long ll;
using namespace std;
const int INF = 1e9;
const int MOD = 1e9+7;
const double PI=3.14159265358979323846;
int main(){
int k,n,f,ans,sum=0;
cin >> k >> n >> f;
rep(i,f){
int a;
cin >> a;
sum+=a;
}
ans = k*n-sum;
if(ans>=0)cout << ans << endl;
else cout << -1 << endl;
}
rhyoo