您当前的位置: 首页 > 

对方正在debug

暂无认证

  • 6浏览

    0关注

    399博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

使网格图至少有一条有效路径的最小代价(队列/双端队列)

对方正在debug 发布时间:2020-03-01 13:57:53 ,浏览量:6

题目:https://leetcode-cn.com/problems/minimum-cost-to-make-at-least-one-valid-path-in-a-grid/ 更简洁的做法是用双端队列,当时没相到

class Solution {
public:
    /*
    *队列:把同层次的优先遍历
    */
    struct node{
        int val;
        int x,y;
        node(){}
        node(int _val,int _x,int _y):val(_val),x(_x),y(_y){}
    };
    int m,n;
    bool check(int x,int y ){
        return (x>=0&&x=0&&y            
关注
打赏
1664895754
查看更多评论
0.0371s