結果
問題 | No.143 豆 |
ユーザー |
![]() |
提出日時 | 2016-05-10 21:13:23 |
言語 | C90 (gcc 12.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 1,000 ms |
コード長 | 234 bytes |
コンパイル時間 | 157 ms |
コンパイル使用メモリ | 20,352 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-07-23 10:29:52 |
合計ジャッジ時間 | 749 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 17 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:6:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 6 | scanf("%d%d%d", &k, &n, &f); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ main.c:10:17: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 10 | scanf("%d", &a); | ^~~~~~~~~~~~~~~
ソースコード
#include <stdio.h> int main(void){ int k, n, f, i, a; scanf("%d%d%d", &k, &n, &f); k *= n; for(i = 0; i < f; i++){ scanf("%d", &a); k -= a; } if(k < 0){ printf("%d", -1); }else{ printf("%d", k); } return 0; }