結果
問題 | No.1517 Party Location |
ユーザー |
|
提出日時 | 2021-05-28 20:29:40 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 407 bytes |
コンパイル時間 | 1,958 ms |
コンパイル使用メモリ | 191,876 KB |
最終ジャッジ日時 | 2025-01-21 19:06:13 |
ジャッジサーバーID (参考情報) |
judge2 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 13 |
ソースコード
#include<bits/stdc++.h> using namespace std; using ll = long long int; using ld = long double; #define pow(n,m) powl(n,m) #define sqrt(n) sqrtl(n) const ll MAX = 5000000000000000000; const ll MOD = 0; void randinit(){srand((unsigned)time(NULL));} int main(){ ll d,a,b; cin >> d >> a >> b; ll ans = MAX; for(ll i = 0;i <= d;i++) ans = min(ans,i * a + (d - i) * b); cout << ans << endl; }