結果

問題 No.2138 Add Bacon
ユーザー ForestedForested
提出日時 2022-12-01 07:40:19
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 235 bytes
コンパイル時間 2,266 ms
コンパイル使用メモリ 191,180 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-16 23:26:20
合計ジャッジ時間 7,677 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
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 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
testcase_20 RE -
testcase_21 RE -
testcase_22 RE -
testcase_23 RE -
testcase_24 RE -
testcase_25 RE -
testcase_26 RE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:5:10: warning: 'a' is used uninitialized [-Wuninitialized]
    5 |     scanf("%d%d%d%d%d", a, b, c, d, e);
      |     ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:4:9: note: 'a' was declared here
    4 |     int a, b, c, d, e;
      |         ^
main.cpp:5:10: warning: 'b' is used uninitialized [-Wuninitialized]
    5 |     scanf("%d%d%d%d%d", a, b, c, d, e);
      |     ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:4:12: note: 'b' was declared here
    4 |     int a, b, c, d, e;
      |            ^
main.cpp:5:10: warning: 'c' is used uninitialized [-Wuninitialized]
    5 |     scanf("%d%d%d%d%d", a, b, c, d, e);
      |     ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:4:15: note: 'c' was declared here
    4 |     int a, b, c, d, e;
      |               ^
main.cpp:5:10: warning: 'd' is used uninitialized [-Wuninitialized]
    5 |     scanf("%d%d%d%d%d", a, b, c, d, e);
      |     ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:4:18: note: 'd' was declared here
    4 |     int a, b, c, d, e;
      |                  ^
main.cpp:5:10: warning: 'e' is used uninitialized [-Wuninitialized]
    5 |     scanf("%d%d%d%d%d", a, b, c, d, e);
      |     ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:4:21: note: 'e' was declared here
    4 |     int a, b, c, d, e;
      |                     ^

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
int main() {
    int a, b, c, d, e;
    scanf("%d%d%d%d%d", a, b, c, d, e);
    if (d > e) {
        printf("%d\n", a - b + c * (d - e));
    } else {
        printf("%d\n", a - b);
    }
}
0