当前位置:网站首页>leetcode6133. 分组的最大数量(中等)
leetcode6133. 分组的最大数量(中等)
2022-08-01 02:45:00 【重you小垃】
思路:技巧题
找满足m * (1 + m) / 2 <= n 的最大m即可。
class Solution {
public:
int maximumGroups(vector<int>& grades) {
int n = grades.size();
int i = 0;
for (; i * (i + 1) <= 2 * n; ++i) {
}
return i - 1;
}
};
边栏推荐
- Introduction to the decision logic of WAASAP WebClient UI page labels
- Introduction to machine learning how to?
- MYSQL Keyword Explain Analysis
- Modify Postman installation path
- MYSQL master-slave replication
- RTL8762DK uses DebugAnalyzer (four)
- 787. 归并排序
- Daily practice of LeetCode - Circular linked list question (interview four consecutive questions)
- 【元胞自动机】基于matlab界面聚合元胞自动机模拟【含Matlab源码 2004期】
- HIRO: Hierarchical Reinforcement Learning 】 【 Data - Efficient Hierarchical Reinforcement Learning
猜你喜欢
Google Earth Engine - Error resolution of Error: Image.clipToBoundsAndScale, argument 'input': Invalid type
二舅
RTL8762DK RTC (5)
《少年派2》:新男友竟脚踩两只船,林妙妙与钱三一感情回温
MYSQL-Batch insert data
IDEA does not recognize the module (there is no blue square in the lower right corner of the module)
IDEA debugging
Open source project site must-have & communication area function
RTL8762DK WDG (six)
ARM 交叉编译
随机推荐
The kernel of the decompression process steps
MYSQL logical architecture
leetcode: 1562. Find latest grouping of size M [simulation + endpoint record + range merge]
Solve the problem that Excel opens very slowly after installing MySQL
[Data analysis] Based on matlab GUI student achievement management system [including Matlab source code 1981]
Handwritten binary search tree and test
在打开MYSQL表时,有的可以显示编辑,有的没有,如何设置。
Soft Exam Senior System Architect Series: Basic Knowledge of System Development
这个地图绘制工具太赞了,推荐~~
MYSQL query interception optimization analysis
High dimensional Gaussian distribution basics
每周小结(*67):为什么不敢发表观点
The IDEA can't find or unable to load The main class or Module "*" must not contain The source root "*" The root already belongs to The Module "*"
Beijing suddenly announced that yuan universe big news
初出茅庐的小李第112篇博客项目笔记之机智云智能浇花器实战(1)-基础Demo实现
MYSQL two-phase commit
Nmap manuals - the full version
second uncle
How to download the Keil package
IDEA modifies the annotation font