結果

問題 No.143 豆
ユーザー shakayami
提出日時 2023-02-09 03:51:48
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 247 bytes
コンパイル時間 609 ms
コンパイル使用メモリ 65,548 KB
最終ジャッジ日時 2025-02-10 11:44:59
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;
int main(void){
    int K,N,F;
    cin>>K>>N>>F;
    int ans=N*K;
    for(int i=0;i<F;i++){
        int A;
        cin>>A;
        ans-=A;
    }
    if (ans<0){
        ans=-1;
    }
    cout<<ans<<endl;
}
0