当前位置:网站首页>Greedy distribution problem (1)
Greedy distribution problem (1)
2022-06-22 22:40:00 【Douglas_ LT】
A daily topic ing, Today is a simple question Power button 455. Assign Cookies
class Solution {
public:
int findContentChildren(vector<int>& g, vector<int>& s) {
sort(g.begin(),g.end());
sort(s.begin(),s.end());
int child=0,cookie=0;
while(child<g.size()&&cookie<s.size())
{
if(g[child]<=s[cookie])
{
child++;
cookie++;
}
else
cookie++;
}
return child;
}
};
边栏推荐
- R language builds a binary classification model based on H2O package: using H2O GLM constructs regularized logistic regression model and uses H2O AUC value of AUC calculation model
- v-if和v-for哪个优先级更高?
- Redis-分布式锁
- How to quickly build an enterprise knowledge base at low cost?
- A SQL optimization case using order by and rownum
- 卸载mavros
- Explain the startup process of opengauss multithreading architecture in detail
- How to carry out encryption protection for equipment under extortion virus rampant
- Cvpr2022 𞓜 feature decoupling learning and dynamic fusion for re captured images
- Pycharm configuring remote connection server development environment
猜你喜欢

General trend wisdom to create inclined model and cut monomer

How to quickly build an enterprise knowledge base at low cost?

腾讯云上传文件出现的问题:in a frame because it set ‘X-Frame-Options‘ to ‘deny‘.

7-1 creating a binary tree from a preorder sequence
![[recommended by Zhihu knowledge master] castle in UAV - focusing on the application of UAV in different technical fields](/img/3b/8916c543c149292221ce500209df0d.png)
[recommended by Zhihu knowledge master] castle in UAV - focusing on the application of UAV in different technical fields

Las point cloud create mesh

Uniapp applet mall develops thinkphp6 points mall, group purchase and seckill packaged app

Is it bad for NFT that the market starts to cool down?
![[geometric vision] 4.2 piecewise linear transformation](/img/1e/a810f4d7e9a6a34647b5cb56fdde67.png)
[geometric vision] 4.2 piecewise linear transformation

Implementation of depth traversal adjacency matrix of figure 6-5
随机推荐
322. change exchange
腾讯云上传文件出现的问题:in a frame because it set ‘X-Frame-Options‘ to ‘deny‘.
Lua-- use of data types, variables, loops, functions and operators
How much do you know about the cause of amplifier distortion?
组合总数[标准回溯 + 回溯技巧--降低栈深度]
自助图书馆系统-Tkinter界面和openpyxl表格综合设计案例
Seriously, the hang up of the kotlin collaboration process is not so mysterious (principle)
Kdd'22 | Ali: fine tuning CTR estimation based on EE exploration
[chess life] 01 life is like chess
NFT can only be viewed from afar, but not blatantly played
SPA项目开发之首页导航+左侧菜单
Uninstall mavros
卸载mavros
RapidEye快鸟、SPOT卫星遥感影像数据
The xinjietu x70s has been listed for 87900 times and has leapfrogged the class in space safety. It is worthy of being a 7-seat SUV of the National University of China
Why do you think it is common for Chinese people to earn more than 10000 yuan a month?
The mental process and understanding of visual project code design
Registration of spa project development
Several ways of redis persistence -- deeply parsing RDB
Task management of embedded development foundation (thread management)