上一页 1 ··· 33 34 35 36 37 38 39 40 41 ··· 50 下一页
摘要: 题面维护一个数列,提供以下两种操作: 1、 查询操作:查询当前数列中末尾L个数中的最大的数,并输出这个数的值。 2、 插入操作:将n加上t,其中t是最近一次查询操作的答案(如果还未执行过查询操作,则t=0),并将所得结果对一个固定的常数D取模,将所得答案插入到数列的末... 阅读全文
posted @ 2018-04-22 20:28 gwj1139177410 阅读(106) 评论(0) 推荐(0) 编辑
摘要: 题面You have N integers, A1, A2, … , AN. You need to deal with two kinds of operations. One type of operation is to add some given numbe... 阅读全文
posted @ 2018-04-20 21:35 gwj1139177410 阅读(87) 评论(0) 推荐(0) 编辑
摘要: 题面已知一个数列,你需要进行下面两种操作: 1.将某区间每一个数加上x 2.求出某区间每一个数的和题解区间修改+区间查询 线段树模板#include#define maxn 100010#define lch p>1; sgt[lch].addmark ... 阅读全文
posted @ 2018-04-20 21:33 gwj1139177410 阅读(109) 评论(0) 推荐(0) 编辑
摘要: 题面RMQ问题题解线段树#include#includeusing namespace std;const int maxn = 100010;int a[maxn];struct node{ int l, r; int val;}sgt[maxn m)a... 阅读全文
posted @ 2018-04-20 13:20 gwj1139177410 阅读(111) 评论(0) 推荐(0) 编辑
摘要: 1 小黄鸭调试法来自维基:小黄鸭调试法是软件工程中使用的调试代码方法之一。就是在程序的调试、纠错或测试过程中,耐心地向小黄鸭解释每一行程序的作用,以此来激发灵感。2 输出中间值在关键位置输出值适用于以下一些: 数据输入,输出 死循环,盏溢出 过程值,语义分析(较痛苦 ... 阅读全文
posted @ 2018-04-17 21:30 gwj1139177410 阅读(252) 评论(0) 推荐(0) 编辑
摘要: 题面:给定一个二分图 求最大匹配思路:匈牙利算法,DFS版本。O(V*E) #include#include#includeusing namespace std;const int N = 3e6;vectorG[N];int po[N], book[N], ans... 阅读全文
posted @ 2018-04-17 21:01 gwj1139177410 阅读(192) 评论(0) 推荐(0) 编辑
摘要: 题面以一个长为n的数列,求连续子段的最大值。思路1直接枚举O(n^3)TLE稳稳的#includeusing namespace std;int n, a[50050], ans;int main(){ cin>>n; for(int i = 1; i >... 阅读全文
posted @ 2018-04-17 20:58 gwj1139177410 阅读(129) 评论(0) 推荐(0) 编辑
摘要: 并查集模板,就酱紫。#includeusing namespace std;#define mod 998244353long long ans;int fa[4000010];int find(int x){ return fa[x]==x?x:fa[x]=find... 阅读全文
posted @ 2018-04-17 13:00 gwj1139177410 阅读(126) 评论(0) 推荐(0) 编辑
摘要: 一、为什么要卡常数?OI中数据结构与常数优化关系很大的如果你常数好可以暴力过数据结构题啦~如果你常数不好即使复杂度一样也会被出题人卡~二、常用的卡常数方法1、卡IO(输入输出)比较简单的写法:int readint(){ int op=1,x=0; char ... 阅读全文
posted @ 2018-04-15 09:33 gwj1139177410 阅读(229) 评论(0) 推荐(0) 编辑
摘要: QQ聊天机器人。 原理:在Webqq上进行操作。主要: Qqbot项目https://github.com/pandolia/qqbot -Game:https://github.com/louxinye/lxybot -双鹤拼 https://github.com/... 阅读全文
posted @ 2018-04-11 15:51 gwj1139177410 阅读(296) 评论(0) 推荐(0) 编辑
上一页 1 ··· 33 34 35 36 37 38 39 40 41 ··· 50 下一页
选择