結果
問題 | No.143 豆 |
ユーザー |
|
提出日時 | 2021-12-03 20:30:04 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 265 bytes |
コンパイル時間 | 1,507 ms |
コンパイル使用メモリ | 165,792 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-06 03:59:28 |
合計ジャッジ時間 | 1,942 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 17 |
ソースコード
#include <bits/stdc++.h>using namespace std;const int MAXN=1e4+50;int N,K,F,a[MAXN];int main(){scanf("%d%d%d",&N,&K,&F);int Sum=0;for(int i=1;i<=F;i++){scanf("%d",&a[i]);Sum+=a[i];}if(Sum>N*K)puts("-1");elseprintf("%d\n",N*K-Sum);}