結果

問題 No.1517 Party Location
ユーザー Yahiya YusufzaiYahiya Yusufzai
提出日時 2021-05-28 22:08:06
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 1,363 bytes
コンパイル時間 1,684 ms
コンパイル使用メモリ 164,772 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-02 04:12:19
合計ジャッジ時間 2,489 ms
ジャッジサーバーID
(参考情報)
judge12 / judge16
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include<bits/stdc++.h>
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#define all(k) k.begin(),k.end()
#define INF 1e9
#define repk(i,a,n) for(int i=a;i<=n;i++)
#define rep(i,a,n) for(int i=a;i<n;i++)
#define rep2(i,a, n) for(int i=a;i<n;i+=2)
#define per(i,a,n) for(int i=n-1;i>=a;i--)
#define pb push_back
#define ub pop_back
#define eb emplace_back
#define ll  long long 
#define ull unsigned long long
#define pi pair<int,int>
#define vc vector<char>
#define vpi vector<pi>
#define vi vector<int>
#define vl vector<ll>
#define vvi vector<vi>
#define vb vector<bool>
#define pq priority_queue
#define vvc vector<vc>
#define mi map<int,vi>
#define mset map<string,set<char>>
#define umap unordered_map
#define int int64_t
using namespace std;
#define fi first
#define se second
const int mod = int(1e9)+7;
const int nn= 1e7;
int ar(int x,int y){
  int res=1;

  while(y){
    if(y&1)
      res=(res*x)%mod;

    y>>=1;
    x=((x*x)%mod);
  }
return res;
}
int gcd(int x,int y){
  if(x==0)
    return y;

  return gcd(y%x,x);
}


void sol()
{
  int d;cin>>d;
  int a,b;cin>>a>>b;
int mn=INT_MAX;
  for(int x=0;x<=d;x++){
    mn=min(mn,a*x+(d-x)*b);
  }
  cout<<mn;
cout<<'\n';
}



int32_t main() {


int t=1;
   // cin>>t;
 for(int i=1;i<=t;++i){

 // cout<<"Case #"<<i<<": ";
sol();


}


  return 0;
}

0