#include <leetcode.h>
|
static int | get_cost (int startAt, int moveCost, int pushCost, const int num[4]) |
|
static int | minCostSetTime (int startAt, int moveCost, int pushCost, int targetSeconds) |
|
◆ get_cost()
int leetcode::minimum_cost_to_set_cooking_time::Solution::get_cost |
( |
int |
startAt, |
|
|
int |
moveCost, |
|
|
int |
pushCost, |
|
|
const int |
num[4] |
|
) |
| |
|
static |
在文件 leetcode.cpp 第 2307 行定义.
2309 int current = startAt;
2311 for(
int i = 0; i < 4; i++) {
2312 if(num[i] == 0 && flag) {
2316 if(num[i] != current) {
被这些函数引用 minCostSetTime().
◆ minCostSetTime()
int leetcode::minimum_cost_to_set_cooking_time::Solution::minCostSetTime |
( |
int |
startAt, |
|
|
int |
moveCost, |
|
|
int |
pushCost, |
|
|
int |
targetSeconds |
|
) |
| |
|
static |
在文件 leetcode.cpp 第 2288 行定义.
2289 int ans = (moveCost + pushCost) * 4;
2290 int minute = targetSeconds / 60;
2291 int second = targetSeconds % 60;
2292 while(minute > 99) {
2296 const int num[4] = {minute / 10, minute % 10, second / 10, second % 10};
2297 ans = min(ans,
get_cost(startAt, moveCost, pushCost, num));
2298 if(second + 60 < 100 && minute - 1 >= 0) {
2301 const int num[4] = {minute / 10, minute % 10, second / 10, second % 10};
2302 ans = min(ans,
get_cost(startAt, moveCost, pushCost, num));
static int get_cost(int startAt, int moveCost, int pushCost, const int num[4])
引用了 get_cost().
该类的文档由以下文件生成: