結果

問題 No.143 豆
ユーザー ut0sut0s
提出日時 2019-09-05 21:34:45
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 506 bytes
コンパイル時間 1,503 ms
コンパイル使用メモリ 164,856 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-03 22:48:35
合計ジャッジ時間 3,516 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 RE -
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 AC 2 ms
4,376 KB
testcase_12 RE -
testcase_13 AC 2 ms
4,376 KB
testcase_14 AC 1 ms
4,376 KB
testcase_15 AC 1 ms
4,376 KB
testcase_16 AC 1 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

/**
  @file 143.cpp
  @title  No.143 豆 - yukicoder
  @url https://yukicoder.me/problems/no/143
**/

#include <bits/stdc++.h>
using namespace std;

typedef long long LL;
#define ALL(obj) (obj).begin(), (obj).end()
#define REP(i, N) for (int i = 0; i < (N); ++i)

int main() {
  int K, N, F;
  cin >> K >> N >> F;
  vector<int> A(N, 0);
  LL ans = K * N;
  REP(i, F) {
    cin >> A[i];
    ans -= A[i];
  }

  if (ans < 0) {
    cout << "-1" << endl;
  } else {
    cout << ans << endl;
  }

  return 0;
}
0