You are given an m x n matrix M initialized with all 0's and an array of operations ops, where ops[i] = [ai, bi] means M[x][y] should be incremented by one for all 0 <= x < ai and 0 <= y < bi.

Count and return the number of maximum integers in the matrix after performing all the operations.
  

class Solution {
public:
int maxCount(int m, int n, vector<vector<int>>& ops) { //取所有操作的交集就是最大int number的个数 冷静思考就没问题 啊哈哈哈
if(ops.size()==0) return m*n;
int limit_m=m,limit_n=n;
for(auto aa:ops)
{
limit_m=min(limit_m,aa[0]);
limit_n=min(limit_n,aa[1]);
}
return limit_m*limit_n;
}
};
  

最新文章

  1. ActiveMQ结合Spring开发
  2. 自己封装一个Log模块
  3. php 时间倒计时
  4. {dockerUI}在服务器上直接安装shipyard/shipyard
  5. hadoop的ganglia数据监控
  6. c# 自定义多选下拉列表2
  7. NSURLConnection从入门到放弃
  8. SpringMVC(二):RequestMapping修饰类、指定请求方式、请求参数或请求头、支持Ant路径
  9. android获取短信并自动填充
  10. eclipse使用报错集锦
  11. day24 Pythonpython 面向对象设计 类
  12. [2017-7-26]Android Learning Day4
  13. SpringBoot 使用validation数据校验
  14. Lily-一个埋点管理工具
  15. 全网最详细的Windows系统里Oracle 11g R2 Database(64bit)安装后的初步使用(图文详解)
  16. 【爬坑】在 IDEA 中运行 Hadoop 程序 报 winutils.exe 不存在错误解决方案
  17. .NET版UEditor报请求后台配置项http错误,上传功能无法使用的错误解决
  18. Linux中的任务调度
  19. 【经典数据结构】Trie
  20. BZOJ4892 Tjoi2017dna(后缀数组)

热门文章

  1. Android Studio 查看SQLite数据库存储位置及文件
  2. no space left on device 磁盘空间不足
  3. c++学习笔记6(结构化程序设计)
  4. 问题 K: A/B Problem
  5. CodeGuide 300+文档、100+代码库,一个指导程序员写代码的,Github 仓库开源啦!
  6. 大爽Python入门教程 3-3 循环:`for`、`while`
  7. ajax的get方法获取豆瓣电影前10页的数据
  8. PLSQL 删表 恢复
  9. Windows11 如何让开始菜单出现休眠选项(Windows11如何开启休眠功能?)Windows家庭版
  10. 动图图解!怎么让goroutine跑一半就退出?