随笔分类 -  队列

摘要:problemsolutioncodes#includeusing namespace std;int le[100010], ri[100010], book[100010];int main(){ int n; cin>>n; ri[0] = 1; ... 阅读全文
posted @ 2018-06-08 22:07 gwj1139177410 阅读(118) 评论(0) 推荐(0)
摘要:problem给你一个长为n的序列求一个长不超过m的连续子段,使子段和最大solution如果n#include#define maxn 300010using namespace std;int a[maxn], q[maxn];long long s[maxn],... 阅读全文
posted @ 2018-06-03 10:25 gwj1139177410 阅读(112) 评论(0) 推荐(0)
摘要:problem有n个小组,进行排队。当一个人来到队伍时,若队伍中有自己小组成员时,他就直接站到其后面如果没有,则站到队伍最后面,形成自己小组的第一个入队元素。出队列时,给出出队指令,输出出队成员号码。solution维护一个队列数组q和总队列p,分别表示每个小组在队伍... 阅读全文
posted @ 2018-06-01 20:59 gwj1139177410 阅读(147) 评论(0) 推荐(0)
摘要:problemsolutioncodes//STL大法好#include#include#includeusing namespace std;queueq;sets;int main(){ int m, n, ans = 0; cin>>m>>n; ... 阅读全文
posted @ 2018-05-22 13:21 gwj1139177410 阅读(99) 评论(0) 推荐(0)

选择