摘要:
link 参考@vividlau https://leetcode.com/problems/new-21-game/discuss/220949/Python-3-Memorize-DFS-from-O(KW%2BW)-to-O(K-%2B-W) class Solution { public: 阅读全文
摘要:
link 题解: 按高度升序排序,若高度相同,按宽度降序排序。到i后,用线段树找w,d 在[0,0]-[wi-1,di-1]的最大值,更新此节点。 class Solution { public: unordered_map<int,int> seg[3010<<2]; int qx1,qy1,qx 阅读全文
摘要:
link #include <bits/stdc++.h> # define LL long long using namespace std; struct Edge{ int to; int next; }e1[500010], e2[500010]; int head1[100010]; in 阅读全文
摘要:
link class Solution { public: int maxSubarraySumCircular(vector<int>& A) { int maxsum=INT_MIN; int minsum=INT_MAX; int total=0; int curmax=0; int curm 阅读全文