Submission #1735749


Source Code Expand

#include <bits/stdc++.h>
using namespace std;
 
#define DEBUG(x) cerr << #x << ": " << x << endl;
#define ll long long
 
ll min(ll a, ll b) {
    return a < b ? a : b;
}
 
int main() {
    int n, h, a, b, c, d, e;
    cin >> n >> h >> a >> b >> c >> d >> e;
 
    ll m_min = 1e15;
    for (int x = 0; x <= n; x++) {
        // int y = n - x;
        for (int y = 0; y <= n; y++) {
            int manzokudo = h + b*x + d*y - (n - x - y)*e;
            if ( manzokudo > 0) {
                m_min = min( m_min, ll(a*x + c*y) );
            }
        }
    }
 
    printf("%lld\n", m_min);
 
    return 0;
}

Submission Info

Submission Time
Task C - 節制
User nomi
Language C++14 (GCC 5.4.1)
Score 0
Code Size 633 Byte
Status CE

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:5:12: error: expected primary-expression before ‘long’
 #define ll long long
            ^
./Main.cpp:21:37: note: in expansion of macro ‘ll’
                 m_min = min( m_min, ll(a*x + c*y) );
                                     ^