线段树进阶,主席树,莫队,相似kmp,悬线,单调栈,单调队列,ac自动机,后缀数组,后缀自动机

图论:最短路,差分约束,二分图,网络流,连通分量 不学图论了我太难了
 
三分找,单调增+max+单调减/单调减+min+单调加,中的max/min,复杂度2log3(n)(比二分慢)
double three_devide(double low,double up)
{
double m1,m2;
while(up-low>=eps)
{
m1=low+(up-low)/;
m2=up-(up-low)/;
if(f(m1)<=f(m2))
low=m1;
else
up=m2;
}
return (m1+m2)/;
}

单调队列

#include <iostream>
using namespace std;
const int N = ; // 数组长度的最大值
struct data {
int id, value;
} q[N];
int a[N], n, k, l, r;
int main() {
scanf("%d%d", &n, &k);
for (int i = ; i < n; ++i) {
scanf("%d", &a[i]);
}
l = , r = -; // 队首和队尾在数组 q 中的下标
for (int i = ; i < n; ++i) {
while (l <= r && q[l].id <= i - k) l++; // 不断弹出不符合要求的队首元素
while (l <= r && q[r].value <= a[i]) r--; // 不断弹出不符合要求的队尾元素
q[++r] = {i, a[i]}; // 将当前元素入队
printf("%d %d\n", i, q[l].value); // 输出当前滑动窗口内的最大值
}
return ;
}
#include<bits/stdc++.h>
using namespace std;
const int maxn=1e6+;
int a[maxn],out,i,l=,r=-;
char ch[];
struct data
{
int id,value;
}q[maxn]; int main()
{
scanf("%s",ch);
while(scanf("%s",ch))
{
if(ch[]=='E')return ;
else if(ch[]=='O')
{
if(l>r)printf("%d\n",-);
else
{
out++;
while(l<=r&&q[l].id<out)l++;
if(l>r)printf("%d\n",-);
else printf("%d\n",q[l].value);
}
}
else if(ch[]=='I')
{
int x;
scanf("%d",&x);
a[i++]=x;
while(l<=r&&q[r].value<x)r--;
q[++r]={i-,x};
printf("%d\n",q[l].value);
}
}
return ;
}

https://oi-wiki.org/

2019ccpc厦门+?

try a try,拿个牌子叭(*╹▽╹*)

...

goal的更多相关文章

  1. maven install Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.1.1:war (default-war) on project web_nanchang

    maven打包成war时,报错:Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.1.1:war (default- ...

  2. Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.7:run (dist) on project hadoop-kms: An Ant BuildException has occured

    编译cdh版hadoop2.5.0出现的问题 系统: CentOs66 64位 JDK:1.7 Maven: 3.0.5 Protobuf: libprotoc 2.5.0 编译命令: mvn pac ...

  3. Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project LogTest: Compilation failure -> [Help 1]

      [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default ...

  4. [ERROR] Failed to execute goal org.apache.maven.plugins:maven-install-plugin:2.3.1:

    security-sdk-1.0.jar已经存在于D:/secServerSDK-test/src/main/resources/lib下 报错如下: xxxxxx@xxxxxxxx /d/secSe ...

  5. [ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2.4:create (default-cli) on project standalone-pom: Unable to parse configuration of 3: mojo org.apache.maven.plugins:

    问题: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2.4:create (defau ...

  6. Failed to execute goal org.codehaus.cargo:cargo-maven2-plugin:1.2.3:run (default-cli) on project Maven_WebTest: Execution default-cli of goal org.codehaus.cargo:cargo-maven2-plugin:1.2.3:run failed: C

    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/20 ...

  7. Failed to execute goal org.codehaus.mojo:rpm-maven-plugin:2.1.1:rpm (default) on project **

    maven编译项目时报错:Failed to execute goal org.codehaus.mojo:rpm-maven-plugin:2.1.1:rpm (default) on projec ...

  8. maven 错误No goals have been specified for this build. You must specify a valid lifecycle phase or a goal in the format

    [INFO] Scanning for projects... [INFO] ------------------------------------------------------------- ...

  9. [ERROR] Failed to execute goal org.apache.maven.plugins:maven-jar-plugin:2.3.1:jar (default-jar) on

    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-jar-plugin:2.3.1:jar (default-jar) on ...

  10. maven install 报错Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project*****

    [ERROR]Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-co ...

随机推荐

  1. php查询字符串的函数

    /* 查找一个字符串在另一个字符串的第一次出现,并返回其余部分(strstr别名) */ var_dump(strchr("hello world hello", "wo ...

  2. Java设计模式之单利模式(Singleton)

    单利模式的应用场景: 单利模式(Singleton Pattern)是指确保一个类在任何情况下都绝对只有一个实例.并提供一个全局反访问点.单利模式是创建型模式.单利模式在生活中应用也很广泛,比如公司C ...

  3. SSE图像算法优化系列三十:GIMP中的Noise Reduction算法原理及快速实现。

    GIMP源代码链接:https://gitlab.gnome.org/GNOME/gimp/-/archive/master/gimp-master.zip GEGL相关代码链接:https://gi ...

  4. 浅析ORACLE中NVL/NVL2/DECODE/CASE WHEN的用法

    使用NVL的时候只能对值进行是否为空的判断,基本语法是NVL( 值1, ,结果2).它的功能是如果值1为空,则此函数返回结果2,不为空的话直接输出值1(如果两个参数都为空,那么还是返回空): NVL2 ...

  5. python:模块1——标准库简介

    一.文档 windows系统:IDLE中打开帮助文档 Tutorial:简单入门 Library Reference:python内置函数和标准库(看不完的,当做字典来查)(此外还有pypi(拍派社区 ...

  6. 目录(cd mkdir rmdir rm pwd ls) 文件(ln touch mv rm cat more head rail) 文件权限(chmod chown chgrp) 文件通配符(* ? [])

    记住Linux目录树的结构是一个称职Linux系统管理员的必备素质! 目录漫游cd   cd - 目录显示pwd 目录管理 mkdir -p a/b/c/1 parent创建多层目录 -m 700   ...

  7. Oracle '26-2月 -19 03.34.47.000000 下午' 字符串日期解析

    Oracle数据库, 时间字段是varchar2类型, 存储了 '26-2月 -19 03.34.47.000000 下午' 格式(TIMESTAMP 数据类型)的字符串日期, 将其解析为yyyy-M ...

  8. 扛把子组20191107-4 beta week 2/2 Scrum立会报告+燃尽图 03

    此作业的要求参见https://edu.cnblogs.com/campus/nenu/2019fall/homework/9956 一.小组情况 队名:扛把子 组长:孙晓宇 组员:宋晓丽 梁梦瑶 韩 ...

  9. 扛把子组20191031-8 alpha week 1/2 Scrum立会报告+燃尽图 06

    此作业的要求参见:https://edu.cnblogs.com/campus/nenu/2019fall/homework/9916 一.小组情况 队名:扛把子 组长:孙晓宇 组员:宋晓丽 梁梦瑶 ...

  10. HTTPS 原理分析——带着疑问层层深入

    HTTPS 随着 HTTPS 建站的成本下降,现在大部分的网站都已经开始用上 HTTPS 协议.大家都知道 HTTPS 比 HTTP 安全,也听说过与 HTTPS 协议相关的概念有 SSL .非对称加 ...