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