系列文章:
LeetCode 热题 HOT 100(P1~P10)-CSDN博客
LeetCode 热题 HOT 100(P11~P20)-CSDN博客
LeetCode 热题 HOT 100(P21~P30)-CSDN博客 LC48rotate_image
. - 力扣(LeetCode)
题目:
给定一个 n n 的二维矩阵 matrix 表…
记录到每个结点的最短距离,以此为基础计算后续结点最优值
#include<iostream>
#include<algorithm>
using namespace std;
typedef long long ll;ll gcd(int a, int b){if(!b) return a;return gcd(b, a % b);
}int main(){ll dp[2022] {0};//dp[i]记…