goal
线段树进阶,主席树,莫队,相似kmp,悬线,单调栈,单调队列,ac自动机,后缀数组,后缀自动机
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的更多相关文章
- 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- ...
- 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 ...
- 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 ...
- [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 ...
- [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 ...
- 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 ...
- 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 ...
- 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] ------------------------------------------------------------- ...
- [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 ...
- 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 ...
随机推荐
- activemq 的延迟队列和幂等性检查
一. 延迟消息队列 1. 在提交支付之后,可以发送一个延迟检查的队列,来主动查询用户在支付宝上的支付状态 在mq的配置/config/activeMq.xml的broker实例上配置 schedule ...
- SqlServer2005 查询 第七讲 order by
今天我们来讲sql命令中的参数order by的用法 order by order by:可以理解成[以某个字段排序] order by a,b // a和b都按升序 order by a,b des ...
- Spring-boot构建多模块依赖工程时,maven打包异常:程序包xxx不存在
在qizhi项目改版的时候, 所有代码都迁移好了, 但是compile的时候报程序包*****不存在, 具体到某一个类就是: 找不到符号. 下面这篇文章是正解 http://hbxflihua.ite ...
- Python 常用模块系列学习(3)--configparser module
configpaser 模块----用于生成和修改常见配置文档 1. config 对象的创建: import configparser #导入模块 config = configparser.Con ...
- 深度剖析Javascript执行环境、作用域链
一.执行环境 执行环境(也叫做执行上下文,Execution Context)是Javascript中最为重要的一个概念.执行环境定义了变量或函数有权访问其他数据,决定了它们各自的行为.每个执行环境都 ...
- 磁盘配额管理disk quotas
条件: a.确保系统内核支持,Linux一般都支持 b.确保分区格式支持,ext2都只持! c.安装有quota软件,centos默认都有! (1)检查内核是否打开磁盘配额支持 [root@cento ...
- PHP提高SESSION响应速度的方法有哪些
1.设置多级目录存储SESSION 默认session的存储目录是1级目录,如果用户量比较大,session文件数量就比较大,我们可以设置目录数为2,使用2级目录可以提交查找和存取速度.不过这种方式对 ...
- mysqldump工具实现mysql数据库的备份还原
简介 冷.温.热备份 冷备:读写操作均不可进行 温备:读操作可执行:但写操作不可执行 热备:读写操作均可执行 MyISAM:温备,不支持热备 InnoDB:都支持 不管是热备还原还是冷备还原,还原时都 ...
- 【Luogu P4779】dijkstra算法的堆优化
Luogu P4779 利用堆/优先队列快速取得权值最小的点. 在稠密图中的表现比SPFA要优秀. #include<iostream> #include<cstdio> #i ...
- 基于HTTP协议的WAF绕过
一,畸形包绕过 1.先关闭burpsuite长度更新,为get请求,先使用bp的method转换为POST请求 2.get请求中空格使用%20代替,Connection改为keep-alive 二,分 ...