結果

問題 No.143 豆
ユーザー FVRChanFVRChan
提出日時 2017-09-29 09:17:57
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 294 bytes
コンパイル時間 559 ms
コンパイル使用メモリ 65,176 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-27 16:12:26
合計ジャッジ時間 1,179 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:9:24: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    9 |         int k,n,f;scanf("%d%d%d",&k,&n,&f);
      |                   ~~~~~^~~~~~~~~~~~~~~~~~~
main.cpp:13:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   13 |                 scanf("%d",&are);
      |                 ~~~~~^~~~~~~~~~~

ソースコード

diff #

#include<iostream>
#include<queue>
#include<cstdio>
#include<utility>
#include<algorithm>
#include<cmath>
using namespace std;
int main(){
	int k,n,f;scanf("%d%d%d",&k,&n,&f);
	int sum=k*n;
	int are;
	for(int i=0;i<f;i++){
		scanf("%d",&are);
		sum-=are;
	}if(are<0)are=-1;
	cout<<are<<endl;
}
0