当前位置:网站首页>贪心之分配问题(1)
贪心之分配问题(1)
2022-06-22 17:50:00 【Douglas_LT】
每日一题ing,今天是个简单题力扣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;
}
};
边栏推荐
- Cookie加密3+RPC解法
- Which securities company is better to open an account when making an appointment to play new bonds? It is safer to open an account
- How much do you know about the bloom filter and cuckoo filter in redis?
- 同花顺好用么?手机开户安全么?
- 如何在 FlowUs和Notion 等笔记软件中进行任务管理?
- Alibaba cloud cannot find the account security group id problem during the account transfer
- What is the experience of writing a best seller
- Activity跳转到Fragment的方法(Intent)
- IPLOOK和思博伦通信建立长期合作
- 2022 Chongqing preschool education industry exhibition 𞓜 hi tech Toy Puzzle decompression Toy Expo
猜你喜欢

Notes on new reports

2022年R2移动式压力容器充装试题模拟考试平台操作

IPLOOK和思博伦通信建立长期合作

5GC和卫星融合通信方案

Play typical usage scenarios of kubernetes | dashboard for 5 minutes every day

如何在 FlowUs和Notion 等笔记软件中进行任务管理?

IPLOOK作为O-RAN联盟会员,将共同促进5G产业发展

Babbitt | yuancosmos daily must read: it is said that Tencent has established XR department, and yuancosmos sector has risen again. Many securities companies have issued reports to pay attention to th

Vs Code suddenly fails to jump

2022年G2电站锅炉司炉题库及在线模拟考试
随机推荐
Golang实现基于Redis的可靠延迟队列
2022年5月中国游戏厂商及应用出海 EMEA 地区收入30强
SystemVerilog (12) - $unit declaration space
postman学习
預訓練語言模型,bert,RoFormer-Sim又稱SimBERTv2
阿里云过户找不到账号安全组ID问题
2022焊工(初级)特种作业证考试题库模拟考试平台操作
Makefile将某一部分文件不编译
Jenkins configuration project integration pin notification
Activity跳转到Fragment的方法(Intent)
Oracle中dbms_output.put_line的用法实例
Explain the startup process of opengauss multithreading architecture in detail
使用完整功能模仿设计法
Sort---
plsql变量赋值问题
Vs Code suddenly fails to jump
如何持续突破性能表现? | DX研发模式
IPLOOK和思博伦通信建立长期合作
AUTOCAD——五种标注快捷键
Makefile does not compile some files