- 博客(5)
- 资源 (1)
- 收藏
- 关注
原创 poj 3276(差分思想)
思路:用一个数组前标记和后标记优化中间的遍历,前标记+1后标记-1,这样就能判断是否反转/*I am nothing but I must be everything.*/#include <map>#include <queue>#include <vector>#include <cstdio>#include <c...
2018-11-23 23:17:58 312
原创 堆排序
无聊写个堆排序2333都说堆排序是最不稳定的排序,可我觉得他好稳定(一直是nlogn时间复杂度 这样的排序才靠的住 偷笑)#include <bits/stdc++.h>#define maxn 200005typedef long long ll;using namespace std;ll a[maxn],n;void adjust(ll i,ll le...
2018-11-16 14:07:41 123
原创 堆模板
#include <iostream>#include <cstdio>#include <queue>#include <utility>#define maxn 1000005typedef long long ll;using namespace std;ll head[maxn];ll len = 0,now;voi...
2018-11-06 20:45:51 123
原创 牛可乐发红包脱单ACM赛$ C 区区区间间间(单调栈)
链接:https://ac.nowcoder.com/acm/contest/223/C来源:牛客网 时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 32768K,其他语言65536K64bit IO Format: %lld题目描述给出长度为n的序列a,其中第i个元素为,定义区间(l,r)的价值为请你计算出输入描述:第一行输入数据组数T对于每...
2018-11-04 15:21:16 281
原创 单调队列板子
蒟蒻自己写的垃圾板子,希望大牛指出板子的不足之处#include <iostream>#include <utility>#define maxn 1000005typedef long long ll;using namespace std;ll a[maxn];pair<ll,ll> q[maxn];ll n,m,head,tail...
2018-11-02 23:20:00 275 3
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人