結果
| 問題 |
No.143 豆
|
| コンテスト | |
| ユーザー |
musuchika
|
| 提出日時 | 2019-06-04 20:14:42 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 291 bytes |
| コンパイル時間 | 1,125 ms |
| コンパイル使用メモリ | 157,388 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-09-17 20:51:18 |
| 合計ジャッジ時間 | 1,686 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / 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(){
int i,k,n,f,sum;
scanf("%d%d%d",&k,&n,&f);
k*=n;
while(f--){
scanf("%d",&n);
sum+=n;
}
if(sum<=k)
return k-sum;
else
{
return -1;
}
}
musuchika