You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: searching.md
+20Lines changed: 20 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1038,6 +1038,26 @@ double minmaxGasDist(vector<int> &stations, int k)
1038
1038
}
1039
1039
```
1040
1040
1041
+
### [Minimized Maximum of Products Distributed to Any Store](https://leetcode.com/problems/minimized-maximum-of-products-distributed-to-any-store/description/)
1042
+
```cpp
1043
+
int minimizedMaximum(int n, vector<int>& quantities){
1044
+
function<bool(int)> check = [&](int x) -> bool{
1045
+
int cnt = 0;
1046
+
for (int quantity: quantities)
1047
+
cnt += ceil((double)quantity / x);
1048
+
return cnt <= n;
1049
+
};
1050
+
1051
+
int l = 1, r = *max_element(quantities.begin(), quantities.end());
0 commit comments