結果

問題 No.1517 Party Location
ユーザー shishimaiotoshishishimaiotoshi
提出日時 2021-08-15 16:39:22
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 435 bytes
コンパイル時間 1,587 ms
コンパイル使用メモリ 162,372 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-16 19:14:13
合計ジャッジ時間 2,498 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;
#define rep(i, n, o) for(int i = 0;i < (n);i++)
#define ou(x) cout << x << endl
#define ll long long
#define re return 0

int main(){
   int d, a, b;
   ll ans = 100010100010;
   cin >> d;
   cin >> a >> b;
   rep(i, d, 0){
        if(a == 0 || b == 0){
            ou(0);
            re;
        }
        ll t = i * a + (d - i) * b;
        ans = min(ans, t);
   }
   ou(ans);
    re;
}
0