• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
 






lazy pig~

青灯古佛,不见笑傲江湖...
 
 

Powered by 博客园
博客园 | 首页 | 新随笔 | 联系 | 订阅 订阅 | 管理

2021年9月7日

加油站
摘要: class Solution { public: int canCompleteCircuit(vector<int>& gas, vector<int>& cost) { int sum=0; int start=0; int minsum=INT_MAX; //从0开始求sum,最低点小于0是不 阅读全文
posted @ 2021-09-07 12:40 青衣怒马 阅读(46) 评论(0) 推荐(0)
 
N皇后
摘要: class Solution { public: vector<vector<string>> res; vector<vector<string>> solveNQueens(int n) { vector<string> track; string s=""; for(int i=0;i<n;i 阅读全文
posted @ 2021-09-07 12:32 青衣怒马 阅读(61) 评论(0) 推荐(0)
 
水域大小
摘要: class Solution { public: vector<int> res; vector<int> pondSizes(vector<vector<int>>& land) { vector<vector<bool>> visit(land.size(),vector<bool>(land[ 阅读全文
posted @ 2021-09-07 12:31 青衣怒马 阅读(36) 评论(0) 推荐(0)
 
1221 分割平衡字符串
摘要: class Solution { public: int balancedStringSplit(string s) { int r=0; int res=0; for(int i=0;i<s.size();i++) { if(s[i]=='R') r++; else if(s[i]=='L') r 阅读全文
posted @ 2021-09-07 12:30 青衣怒马 阅读(33) 评论(0) 推荐(0)
 
1391 检查是否存在有效路径 DFS
摘要: class Solution { public: bool res=false; bool hasValidPath(vector<vector<int>>& grid) { vector<vector<bool>> visit(grid.size(),vector<bool>(grid[0].si 阅读全文
posted @ 2021-09-07 12:29 青衣怒马 阅读(57) 评论(0) 推荐(0)
 
盛最多水的容器11 双指针
摘要: class Solution { //两个指针分别指向左右两端,每次值小的前进,因为值大的前进的话永远比不过之前的结果,所以值小的那个不能作为边界了,值小的前移 public: int maxArea(vector<int>& height) { int l = 0, r = height.size 阅读全文
posted @ 2021-09-07 12:28 青衣怒马 阅读(29) 评论(0) 推荐(0)