Update dp_solver.cpp
This commit is contained in:
parent
4bddc7048f
commit
8df6bf6fdf
|
@ -66,8 +66,14 @@ int main() {
|
|||
|
||||
// Set initial value
|
||||
DP[s] = start;
|
||||
|
||||
// Find the optimal solution
|
||||
int sol = 7200000;
|
||||
for (int i = 0; i < 36000 * max_it; i++) {
|
||||
if (DP[i] != -1) {
|
||||
if (i / 36000 > sol / 36000) break;
|
||||
if (DP[i] >= goal && (sol == 7200000 || DP[i] > DP[sol])) sol = i;
|
||||
|
||||
// Calculate parameters
|
||||
int it = i / 36000;
|
||||
int MPQ = (i / 3600) % 10, SB = (i / 360) % 10, M = (i / 36) % 10;
|
||||
|
@ -150,13 +156,6 @@ int main() {
|
|||
}
|
||||
}
|
||||
|
||||
// Find the optimal solution
|
||||
int sol = 7200000;
|
||||
for (int i = 0; i < 36000 * max_it; i++) {
|
||||
if (i / 36000 > sol / 36000) break;
|
||||
if (DP[i] >= goal && (sol == 7200000 || DP[i] > DP[sol])) sol = i;
|
||||
}
|
||||
|
||||
// Print output
|
||||
if (sol != 7200000) {
|
||||
vector<int> output;
|
||||
|
|
Loading…
Reference in a new issue