2 solutions

  • 0
    @ 2025-4-2 16:54:30
    #include <bits/stdc++.h>
    using namespace std;
    #define int long long
    #define endl '\n'
    signed main()
    {
        int n, a, b;
        std:: cin >> n >> a >> b;
        if(2 * a <= b)
        {
            std:: cout << a * n << endl;
            return 0;
        }
        else
        {
            int cnt1 = n / 2;
            std:: cout << b * cnt1 + (n % 2) * a << endl; 
        }
    }
    
    • 0
      @ 2025-4-1 17:06:34

      只需要注意到促销价是否低于普通价格乘 22 即可。

      • 1

      Information

      ID
      1449
      Time
      1000ms
      Memory
      256MiB
      Difficulty
      6
      Tags
      (None)
      # Submissions
      175
      Accepted
      51
      Uploaded By