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 ...
随机推荐
- oracle直接调用web services
oracle调用C#开发web services 1, 去oracle官网上下载dbws-callout-utility-10131.zip 地址:https://oracle-base.com/a ...
- 【algo&ds】【吐血整理】4.树和二叉树、完全二叉树、满二叉树、二叉查找树、平衡二叉树、堆、哈夫曼树、B树、字典树、红黑树、跳表、散列表
本博客内容耗时4天整理,如果需要转载,请注明出处,谢谢. 1.树 1.1树的定义 在计算机科学中,树(英语:tree)是一种抽象数据类型(ADT)或是实作这种抽象数据类型的数据结构,用来模拟具有树状结 ...
- 016.Kubernetes二进制部署所有节点kube-proxy
一 部署 kube-proxy kube-proxy 运行在所有节点上,它监听 apiserver 中 service 和 endpoint 的变化情况,创建路由规则以提供服务 IP 和负载均衡功能. ...
- 斐波那契数列的实现(C语言)
int fibonacci(int positon){ if(position==1||position==2){ return 1; } return fibonacci(position-1)+f ...
- 基于.NetStandard的简易EventBus实现-基础实现
一.问题背景 最近离职来到了一家新的公司,原先是在乙方工作,这回到了甲方,在这一个月中,发现目前的业务很大一部分是靠轮询实现的,例如:通过轮询判断数据处于B状态了,则轮询到数据后执行某种动作,这个其实 ...
- Go 语言优秀资源整理,为项目落地加速🏃
最后更新于2019.11.22 Go 语言优秀资源整理,为项目落地加速
- 力扣(LeetCode)从不订购的客户-数据库题 个人题解
SQL架构 某网站包含两个表,Customers 表和 Orders 表.编写一个 SQL 查询,找出所有从不订购任何东西的客户. Customers 表: +----+-------+ | Id | ...
- python requirements.txt的创建及使用
要求文件(requirements.txt)是安装包的依赖项及版本的记录文件. pip: 创建 (venv) $ pip freeze >requirements.txt 使用 (venv) $ ...
- selenium中延时等待三种方式
selenium中的延时等待方式有三种:强制等待:sleep() 隐示等待:implicitly_wait() 显示等待 WebDriverWait() 1.强制等待:sleep(),time模块 ...
- 2019-9-10:渗透测试,基础学习,nmap扫描命令,php基本语法学习,笔记
nmap参数-sT,使用tcp全连接的方式 ,扫描过程需要三次握手,建立链接,则说明端口开放,扫描速度慢-sS,使用syn的数据包去检测,接收到ACK说明端口开放-sN,null扫描,发出去的数据包不 ...