結果
問題 |
No.143 豆
|
ユーザー |
![]() |
提出日時 | 2020-06-29 16:44:56 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 340 bytes |
コンパイル時間 | 484 ms |
コンパイル使用メモリ | 64,464 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-23 11:32:41 |
合計ジャッジ時間 | 1,109 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 17 |
ソースコード
#include<iostream> using namespace std; int main(){ int k,n,f; cin>>k>>n>>f; int a[f]; for(int i=0;i<f;i++){ cin>>a[i]; } n=n*k; for(int i=0;i<f;i++){ n-=a[i]; } if(n<0){ cout<<"-1"<<endl; return 0; } else{ cout<<n<<endl; return 0; } }