結果

問題 No.143 豆
ユーザー つなぎ
提出日時 2017-02-16 13:56:18
言語 C90
(gcc 12.3.0)
結果
AC  
実行時間 1 ms / 1,000 ms
コード長 244 bytes
コンパイル時間 156 ms
コンパイル使用メモリ 20,864 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-07-23 10:40:47
合計ジャッジ時間 737 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 17
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:5:1: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    5 | scanf("%d %d %d",&k,&n,&f);
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~
main.c:9:3: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    9 |   scanf("%d",&aa[i]);
      |   ^~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include "stdio.h"

int main(void) {
int k,n,f,mame,i,bb=0;
scanf("%d %d %d",&k,&n,&f);
mame=k*n;
int aa[f];
for(i=0;i<f;i++){
  scanf("%d",&aa[i]);
  bb+=aa[i];
}
if(mame-bb<0){
  printf("-1");
  return 0;
}
printf("%d",mame-bb);
  return 0;
}
0