Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 78832b3

Browse files
Create Find Minimum Log Transportation Cost.java
1 parent 96489b1 commit 78832b3

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
class Solution {
2+
public long minCuttingCost(int n, int m, int k) {
3+
long cost = 0;
4+
if (n > k) {
5+
cost += ((long) (n - k)) * (k);
6+
}
7+
if (m > k) {
8+
cost += ((long) (m - k)) * (k);
9+
}
10+
return cost;
11+
}
12+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /