当前位置:网站首页>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;
}
};
边栏推荐
- test
- TCP协议详解
- 《少年派2》:新男友竟脚踩两只船,林妙妙与钱三一感情回温
- 彻底关闭Chrome浏览器更新及右上角的更新提示
- 链式编程、包、访问权限
- 软考高级系统架构设计师系列之:系统开发基础知识
- leetcode:1562. 查找大小为 M 的最新分组【模拟 + 端点记录 + 范围合并】
- 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 "*"
- 【元胞自动机】基于matlab界面聚合元胞自动机模拟【含Matlab源码 2004期】
- Simple vim configuration
猜你喜欢

What practical projects can machine learning beginners learn?
![leetcode: 1648. Color ball with decreasing sales value [Boundary find by two points]](/img/b9/7bd33bd981ace25e3bbfc7be9117ff.png)
leetcode: 1648. Color ball with decreasing sales value [Boundary find by two points]

【 】 today in history: on July 31, "brains in vats" the birth of the participant;The father of wi-fi was born;USB 3.1 standard

纽约大学等 | TM-Vec:用于快速同源检测和比对的模版建模向量

RTL8762DK WDG (six)

opencv 缩小放大用哪种插值更好??

元宇宙改变人类工作模式的四种方式

MYSQL Keyword Explain Analysis

win10 固定本机IP
![[Data analysis] Based on matlab GUI student achievement management system [including Matlab source code 1981]](/img/65/b84443b98c28d2728e9ae44b1294fb.jpg)
[Data analysis] Based on matlab GUI student achievement management system [including Matlab source code 1981]
随机推荐
Fat interface in JQESAP system
High dimensional Gaussian distribution basics
RTL8762DK UART (two)
Raspberry pie arm version of GCC installed configuration and environment variables
IDEA does not recognize the module (there is no blue square in the lower right corner of the module)
彻底关闭Chrome浏览器更新及右上角的更新提示
2. # 代码注释
Nmap 操作手册 - 完整版
Daily practice of LeetCode - Circular linked list question (interview four consecutive questions)
Google Earth Engine - Error resolution of Error: Image.clipToBoundsAndScale, argument 'input': Invalid type
【Make YOLO Great Again】YOLOv1-v7全系列大解析(Neck篇)
MYSQL query interception optimization analysis
HCIP(15)
开源项目站点必备&交流区功能
Introduction to machine learning how to?
这个地图绘制工具太赞了,推荐~~
【入门教程】Rollup模块打包器整合
787. 归并排序
Modify Postman installation path
July Bootcamp (Day 31) - Status Compression