結果
問題 |
No.143 豆
|
ユーザー |
![]() |
提出日時 | 2023-05-30 14:12:38 |
言語 | C (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 1,000 ms |
コード長 | 313 bytes |
コンパイル時間 | 319 ms |
コンパイル使用メモリ | 28,544 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-28 11:51:00 |
合計ジャッジ時間 | 1,342 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 17 |
ソースコード
#include <stdio.h> #include <stdlib.h> int main() { int k, n, f; scanf("%d%d%d", &k, &n, &f); int s = k * n; int* w; w = (int*)malloc(sizeof(int) * f); for (int i = 0; i < f; i++) { scanf("%d", &w[i]); s -= w[i]; } if (s >= 0) { printf("%d", s); } else { printf("-1"); } return 0; }