結果

問題 No.143 豆
ユーザー yn
提出日時 2016-06-14 22:17:40
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 311 bytes
コンパイル時間 633 ms
コンパイル使用メモリ 63,616 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-09 13:48:17
合計ジャッジ時間 3,444 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 1 WA * 3 RE * 13
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:8:10: warning: 'f' is used uninitialized [-Wuninitialized]
    8 |   int a[f];
      |          ^
main.cpp:7:16: note: 'f' declared here
    7 |   int i, k, n, f;
      |                ^

ソースコード

diff #

#include <iostream>
using namespace std;
#define FOR(i,a,b) for(i = a; i < b; i++)
#define REP(i,n) FOR(i,0,n)

int main() {
  int i, k, n, f;
  int a[f];
  int ans = 0;

  std::cin >> k >> n >> f;
  REP(i, f) std::cin >> a[i];

  REP(i, f) ans += a[i];
  ans = k * n - ans;

  std::cout << ans << std::endl;
}
0