ural1126 Magnetic Storms
Magnetic Storms
Memory limit: 64 MB
Input
Output
Sample
input | output |
---|---|
3 |
11 |
分析:可以水过;
代码:
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <climits>
#include <cstring>
#include <string>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <vector>
#include <list>
#define rep(i,m,n) for(i=m;i<=n;i++)
#define rsp(it,s) for(set<int>::iterator it=s.begin();it!=s.end();it++)
#define mod 1000000007
#define inf 0x3f3f3f3f
#define vi vector<int>
#define pii pair<int,int>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define ll long long
#define pi acos(-1.0)
const int maxn=1e5+;
const int dis[][]={{,},{-,},{,-},{,}};
using namespace std;
ll gcd(ll p,ll q){return q==?p:gcd(q,p%q);}
ll qpow(ll p,ll q){ll f=;while(q){if(q&)f=f*p;p=p*p;q>>=;}return f;}
int n,m,k,t,a[maxn],coco[maxn];
priority_queue<int>p;
int main()
{
int i,j;
scanf("%d",&n);
while(scanf("%d",&a[m++])&&a[m-]!=-);
m--;
for(int i=;i<=m-n;i++)printf("%d\n",*max_element(a+i,a+i+n));
//system("pause");
return ;
}
ural1126 Magnetic Storms的更多相关文章
- 1126. Magnetic Storms(单调队列)
1126 最简单的单调队列应用吧 单调队列是指在一个队列中各个元素单调 递增(或者递减),并且各个元素的下标单调 递增. 单调队列的大体操作 进队时,将进队的元素为e,从队尾往前扫描,直到找到一个不大 ...
- ural 1126 Magnetic Storms
http://acm.timus.ru/problem.aspx?space=1&num=1126 #include <cstdio> #include <cstring&g ...
- Magnetic Storms
http://acm.timus.ru/problem.aspx?space=1&num=1126 简单的线段树求区间最值 #include <stdio.h> #include ...
- NOTES : A Model of Gas Exchange for Hyperpolarized Xe(129) Magnetic Resonance of the Lung
NOTES : A Model of Gas Exchange for Hyperpolarized Xe(129) Magnetic Resonance of the Lung 背景知识: Ga ...
- Transcranial magnetic stimulation (TMS)
Transcranial magnetic stimulation (TMS) Effect of Transcranial Magnetic Stimulation on Free Will Tra ...
- MaLoc: a practical magnetic fingerprinting approach to indoor localization using smartphones
https://www.indooratlas.com/ MaLoc: a practical magnetic fingerprinting approach to indoor localizat ...
- Magnetic Fingerprinting Approach to Indoor Localization
Magnetic Fingerprinting Approach to Indoor Localization
- HearthBuddy Magnetic 磁力
https://hearthstone.gamepedia.com/Magnetic Magnetic is an ability exclusive to certain Mech minions ...
- LA 4064 Magnetic Train Tracks
题意:给定平面上$n(3\leq n \leq 1200)$个无三点共线的点,问这些点组成了多少个锐角三角形. 分析:显然任意三点可构成三角形,而锐角三角形不如直角或钝角三角形容易计数,因为后者有且仅 ...
随机推荐
- 解决win7和ubuntu双系统ubuntu不能上网的问题
1.电脑基本配置如下. 我的电脑 戴尔 OptiPlex 9020 Mini Tower操作系统 Windows 7 专业版 64位 SP1 Ubuntu 14.04 2.装系统的过程不再赘述. 可以 ...
- php 控制循环
控制结构语法 endif.endswitch.endwhile.endfor.endforeach
- linq中的分组和排序
一.分组 group 组内成员 by 分组条件 into 组的信息 class Program { static void Main(string[] args) { string[] name = ...
- OpenGL------在Windows系统中显示文字
增加了两个文件,showline.c, showtext.c.分别为第二个和第三个示例程序的main函数相关部分.在ctbuf.h和textarea.h最开头部分增加了一句#include <s ...
- UVALive 3027 并查集
#include <cstdio> #include <queue> #include <cstring> #include <iostream> #i ...
- 设置SVN,Git忽略MAC的.DS_Store文件的方法
设置SVN,Git忽略MAC的.DS_Store文件的方法 I. 显示Mac隐藏文件的命令: defaults write com.apple.finder AppleShowAllFiles -bo ...
- centos yum源问题
在配置CentOS-6.0-x86_64-bin-DVD2.iso作为本地yum源的时候,碰到相当多的问题: ----------------------------------------- 问题 ...
- python 压缩 解压缩 文件
1. 用zipfile模块打包文件或是目录.解压zip文件 http://wangwei007.blog.51cto.com/68019/1045577 #!/usr/bin/env python # ...
- Oracle数据库设计小细节
1. 如果使用PowerDesigner此类工具,注意将工具的导出的SQL语句中对于表的双引号去掉. 2. 建表和建字段的时候,不同单词之间使用下划线分隔,比如 REC_ID 3. Oracle中数值 ...
- 改MAC地址
Google TMAC v6. Or click here