Submission #1779076
Source Code Expand
#include <iostream> #include <algorithm> using namespace std; int main(void){ double n, h, a, b, c, d, e; cin >> n >> h >> a >> b >> c >> d >> e; long long int hungry = h - n*e; unsigned long long cost = 20000000000000; for (int i = 1; i < n + 1; i++){ cost = min(cost, a*i + c*((long long int)(H-n*e-(b+e)*i)/d+e + 1)); } cout << cost << endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | C - 節制 |
User | h2929 |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 395 Byte |
Status | CE |
Compile Error
./Main.cpp: In function ‘int main()’: ./Main.cpp:15:45: error: ‘H’ was not declared in this scope cost = min(cost, a*i + c*((long long int)(H-n*e-(b+e)*i)/d+e + 1)); ^