結果
問題 |
No.143 豆
|
ユーザー |
![]() |
提出日時 | 2019-06-04 20:11:24 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 303 bytes |
コンパイル時間 | 1,396 ms |
コンパイル使用メモリ | 157,980 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-09-17 20:51:15 |
合計ジャッジ時間 | 2,066 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | RE * 17 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:8:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 8 | scanf("%d%d%d",&k,&n,&f); | ~~~~~^~~~~~~~~~~~~~~~~~~ main.cpp:11:13: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 11 | scanf("%d",&n); | ~~~~~^~~~~~~~~
ソースコード
#include <bits/stdc++.h> #include <iostream> //#include<> using namespace std; int main(void){ int i,k,n,f,sum; scanf("%d%d%d",&k,&n,&f); k*=n; for(i=0;i<f;i++){ scanf("%d",&n); sum+=n; } if(sum<=k) return k*n-sum; else { return -1; } }