摘要:
服务器端 #include <stdio.h> #include <unistd.h> #include <sys/socket.h> #include <stdlib.h> #include <ctype.h> #include <arpa/inet.h> #include <sys/types. 阅读全文
摘要:
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 阅读全文
摘要:
trylock: #include <stdio.h> #include <unistd.h> #include <pthread.h> int beginnum=1000; pthread_rwlock_t rwlock=PTHREAD_RWLOCK_INITIALIZER; void* thr_ 阅读全文
摘要:
link 解法: 模拟双端队列。刚开始的N*M个客户一次排队到窗口,并计算一下他们完成服务的时间点。对于每一个后面的人,看哪儿一个窗口最早有人出队,则排在次队,根据队尾的人计算一下此人的结束时间。 最后判断如果一个人的开始服务时间>=17:00,则sorry。 #include <bits/stdc 阅读全文
摘要:
#include <stdio.h> #include <unistd.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <string.h> #include <stdlib.h> #includ 阅读全文
摘要:
link 题解: 参考 https://www.luogu.com.cn/blog/12cow/SBCOI2020 从i到i-1,dp[k+1][j]与dp[i][k]交点左移,deque后端pop,需要多考虑i-1这个点,比较后加到deque前端。 #include <bits/stdc++.h> 阅读全文
摘要:
link 阅读全文
摘要:
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 阅读全文