摘要:
852. 山脉数组的峰顶索引 二分法,如果当前a[m+1] > a[m], 那么m肯定不是峰顶, l = m+1, 否则 m+1肯定在峰顶右边 r = m; class Solution { public: int peakIndexInMountainArray(vector<int>& A) { 阅读全文
摘要:
DGL采用attention的方式为节点加权。 import torch import torch.nn as nn import torch.nn.functional as F from dgl import DGLGraph from dgl.data import citation_grap 阅读全文
摘要:
329. 矩阵中的最长递增路径 题解: 记忆化搜索,dp[i][j]代表以(i,j)结点为起点的最长递增路径。记忆化搜索即可。 class Solution { public: int dp[1000][1000]; int dir[4][2] = {1,0,0,1,-1,0,0,-1}; int 阅读全文