結果

問題 No.143 豆
ユーザー ynyn
提出日時 2016-06-14 22:18:10
言語 C++11
(gcc 11.4.0)
結果
RE  
実行時間 -
コード長 311 bytes
コンパイル時間 361 ms
コンパイル使用メモリ 55,564 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-17 19:44:51
合計ジャッジ時間 2,190 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 WA -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 WA -
testcase_15 RE -
testcase_16 AC 1 ms
5,376 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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