結果
問題 |
No.143 豆
|
ユーザー |
|
提出日時 | 2016-12-21 22:01:03 |
言語 | C90 (gcc 12.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 1,000 ms |
コード長 | 248 bytes |
コンパイル時間 | 112 ms |
コンパイル使用メモリ | 20,480 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-07-23 10:39:10 |
合計ジャッジ時間 | 744 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 17 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:6:17: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 6 | scanf("%d%d%d",&K,&N,&F); | ^~~~~~~~~~~~~~~~~~~~~~~~ main.c:9:33: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 9 | scanf("%d",&A[i]); | ^~~~~~~~~~~~~~~~~
ソースコード
#include<stdio.h> int main(){ int K,N,F,i; long int a; int A[101]; scanf("%d%d%d",&K,&N,&F); a=K*N; for(i=0;i<F;i++){ scanf("%d",&A[i]); a=a-A[i]; } if(a<0) printf("-1\n"); if(a>=0) printf("%ld\n",a); return 0; }