上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 23 下一页
摘要: class Solution { public: bool searchMatrix(vector<vector<int>>& matrix, int target) { int i = matrix.size()-1; int j = 0; while(i>=0&&j<matrix[0].size 阅读全文
posted @ 2021-07-24 13:57 三一一一317 阅读(29) 评论(0) 推荐(0)
摘要: class Solution { public: vector<int> maxSlidingWindow(vector<int>& nums, int k) { priority_queue<pair<int ,int>> q; vector<int> res; //规则:pair的比较,先比较第 阅读全文
posted @ 2021-07-24 13:40 三一一一317 阅读(32) 评论(0) 推荐(0)
摘要: class Solution { public: vector<int> productExceptSelf(vector<int>& nums) { if(nums.size()==0) return {}; vector<int> a(nums.size(),1); vector<int> b( 阅读全文
posted @ 2021-07-24 11:26 三一一一317 阅读(33) 评论(0) 推荐(0)
摘要: /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode() : val(0), next(nullptr) {} * ListNode(int x) : 阅读全文
posted @ 2021-07-24 11:13 三一一一317 阅读(23) 评论(0) 推荐(0)
摘要: /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode() : val(0), left(nullptr), rig 阅读全文
posted @ 2021-07-24 10:34 三一一一317 阅读(22) 评论(0) 推荐(0)
摘要: class Solution { public: int findKthLargest(vector<int>& nums, int k) { priority_queue<int, vector<int>, less<int>> maxheap; for(int i = 0; i < nums.s 阅读全文
posted @ 2021-07-22 23:46 三一一一317 阅读(35) 评论(0) 推荐(0)
摘要: class Solution { public: int maximalSquare(vector<vector<char>>& matrix) { int m = matrix.size(); int n = matrix[0].size(); if(m==0) return 0; vector< 阅读全文
posted @ 2021-07-22 23:45 三一一一317 阅读(39) 评论(0) 推荐(0)
摘要: class Solution { public: bool canFinish(int numCourses, vector<vector<int>>& prerequisites) { vector<vector<int>> edge; vector<int> index; edge.resize 阅读全文
posted @ 2021-07-22 20:11 三一一一317 阅读(48) 评论(0) 推荐(0)
摘要: class Solution { public: int numIslands(vector<vector<char>>& grid) { int row = grid.size(); int col = grid[0].size(); if(row==0) return 0; int count 阅读全文
posted @ 2021-07-22 16:42 三一一一317 阅读(36) 评论(0) 推荐(0)
摘要: /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode() : val(0), next(nullptr) {} * ListNode(int x) : 阅读全文
posted @ 2021-07-22 16:11 三一一一317 阅读(25) 评论(0) 推荐(0)
上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 23 下一页