05 2022 档案
摘要:bool isPOP(const std::vector<int>&src, const std::vector<int>&dst) { int m = src.size(), n = dst.size(); if(m != n)return false; int i = 0, j = 0; std
阅读全文
摘要:#include <iostream> #include <vector> #include <numeric> #include <string> #include <unordered_set> using namespace std; struct TreeNode{ int val = 0;
阅读全文
摘要:#include <iostream> #include <vector> #include <string> #include <unordered_set> #include <unordered_map> #include <map> using namespace std; template
阅读全文
摘要:#include <iostream> #include <vector> #include <stack> #include <queue> #include <algorithm> #include <unordered_map> using namespace std; struct Tree
阅读全文
摘要:#include <iostream> #include <numeric> #include <unordered_map> #include <vector> #include <string> #include <algorithm> using namespace std; int find
阅读全文
摘要:import numpy as np import torch def IOU(box1, box2, wh=False): if wh == False: xmin1,ymin1,xmax1,ymax1 = box1 xmin2,ymin2,xmax2,ymax2 = box2 else: xmi
阅读全文
摘要:#include <iostream> #include <vector> #include <unordered_map> #include <queue> using namespace std; int subarraySum(const vector<int>& nums,int targe
阅读全文
摘要:#include <iostream> #include <vector> #include <list> #include <string> #include <unordered_map> #include <unordered_set> using namespace std; void sw
阅读全文
摘要:#include <iostream> #include <vector> #include <string> #include <unordered_map> #include <unordered_set> using namespace std; int lengthofLongestSubS
阅读全文
摘要:#include <iostream> #include <vector> #include <queue> using namespace std; vector<int>maxSlidingWindow(const vector<int>& nums,int k) { int n = nums.
阅读全文
摘要:#include <iostream> #include <vector> using namespace std; struct Node{ int val = 0; Node* next = nullptr; Node(int val_):val(val_){} }; int conquer(c
阅读全文
摘要:#include <iostream> #include <numeric> #include <algorithm> #include <vector> using namespace std; double findMediaSorted(const vector<int>&n1,const v
阅读全文
摘要:#include <iostream> #include <stack> #include <vector> using namespace std; struct TreeNode{ TreeNode* left = nullptr, *right = nullptr; int val = 0;
阅读全文
摘要:#include <iostream> #include <sstream> #include <queue> #include <string> #include <unordered_set> #include <unordered_map> using namespace std; struc
阅读全文
摘要:#include <iostream> #include <vector> #include <unordered_map> #include <queue> #include <algorithm> using namespace std; bool cmp(pair<int,int>&p1,pa
阅读全文
摘要:#include <iostream> #include <vector> #include <unordered_map> using namespace std; struct LinkNode { int val_ = 0; LinkNode* next = nullptr; LinkNode
阅读全文
摘要:#include <iostream> #include <stack> #include <vector> #include <queue> #include <unordered_map> #include <string> using namespace std; //最小栈 class Mi
阅读全文
摘要:#include <iostream> #include <vector> using namespace std; class DSU{ public: vector<int>parent; DSU(int n) { parent = vector<int>(n); for(int i = 0;
阅读全文
摘要:#include <iostream> #include <string> #include <vector> using namespace std; int lcs(string text1,string text2) { int n1 = text1.size(), n2 = text2.si
阅读全文
摘要:#include <iostream> #include <vector> #include <unordered_set> #include <unordered_map> #include <string> using namespace std; int climbStairs(int n)
阅读全文
摘要:#include <iostream> #include <vector> using namespace std; bool canWin(int n) { vector<bool>dp(max(n+1,4)); dp[3] = dp[1] = dp[2] = true; for(int i =
阅读全文
摘要:#include <iostream> #include <vector> #include <stack> using namespace std; int uniquePaths(int m, int n) { vector<vector<int>>dp(m,vector<int>(n)); f
阅读全文