http://codeforces.com/contest/863/problem/E

注意细节

 #include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <time.h>
#include <string>
#include <set>
#include <map>
#include <list>
#include <stack>
#include <queue>
#include <vector>
#include <bitset>
#include <ext/rope>
#include <algorithm>
#include <iostream>
using namespace std;
#define ll long long
#define minv 1e-6
#define inf 1e9
#define pi 3.1415926536
#define E 2.7182818284
const ll mod=1e9+;//
const int maxn=2e5+; struct node
{
int x,y,z;
}f[maxn]; bool vis[maxn]={}; int cmp(node a,node b)
{
if (a.x==b.x)
return a.y>b.y;
else
return a.x<b.x;
} int main()
{
int n,i,j,yy;
scanf("%d",&n);
for (i=;i<=n;i++)
scanf("%d%d",&f[i].x,&f[i].y),f[i].z=i;
sort(f+,f+n+,cmp);
vis[f[].z]=;
j=;
for (i=;i<=n;)
{
yy=f[j].y+;
i++;
j=i;
while (i<=n && f[i].x<=yy)
{
if (f[i].y>f[j].y)
j=i;
i++;
}
if (f[j].y<=yy-)
j=i;
else
i--;
vis[f[j].z]=;
}
for (i=;i<=n;i++)
if (!vis[i])
{
printf("%d",i);
return ;
}
printf("-1");
return ;
}
/*
3 3687 7959 4918 9822 8049 11728
*/

E. Turn Off The TV Educational Codeforces Round 29的更多相关文章

  1. Educational Codeforces Round 29(6/7)

    1.Quasi-palindrome 题意:问一个字符串(你可以添加前导‘0’或不添加)是否是回文串 思路:将给定的字符串的前缀‘0’和后缀‘0’都去掉,然后看其是否为回文串 #include< ...

  2. Educational Codeforces Round 29

    A. Quasi-palindrome 题目链接:http://codeforces.com/contest/863/problem/A 题目意思:问一个数可不可以在不上一些前缀0以后变成一个回文数. ...

  3. Educational Codeforces Round 41 967 E. Tufurama (CDQ分治 求 二维点数)

    Educational Codeforces Round 41 (Rated for Div. 2) E. Tufurama (CDQ分治 求 二维点数) time limit per test 2 ...

  4. [Educational Codeforces Round 16]E. Generate a String

    [Educational Codeforces Round 16]E. Generate a String 试题描述 zscoder wants to generate an input file f ...

  5. [Educational Codeforces Round 16]D. Two Arithmetic Progressions

    [Educational Codeforces Round 16]D. Two Arithmetic Progressions 试题描述 You are given two arithmetic pr ...

  6. [Educational Codeforces Round 16]C. Magic Odd Square

    [Educational Codeforces Round 16]C. Magic Odd Square 试题描述 Find an n × n matrix with different number ...

  7. [Educational Codeforces Round 16]B. Optimal Point on a Line

    [Educational Codeforces Round 16]B. Optimal Point on a Line 试题描述 You are given n points on a line wi ...

  8. [Educational Codeforces Round 16]A. King Moves

    [Educational Codeforces Round 16]A. King Moves 试题描述 The only king stands on the standard chess board ...

  9. Educational Codeforces Round 6 C. Pearls in a Row

    Educational Codeforces Round 6 C. Pearls in a Row 题意:一个3e5范围的序列:要你分成最多数量的子序列,其中子序列必须是只有两个数相同, 其余的数只能 ...

随机推荐

  1. 第十四次ScrumMeeting博客

    第十四次ScrumMeeting博客 本次会议于12月3日(日)22时整在3公寓725房间召开,持续30分钟. 与会人员:刘畅.辛德泰.张安澜.方科栋. 1. 每个人的工作(有Issue的内容和链接) ...

  2. HDFS handler

    http://docs.oracle.com/goldengate/bd1221/gg-bd/GADBD/GUID-85A82B2E-CD51-463A-8674-3D686C3C0EC0.htm#G ...

  3. vim 多个文件切换 :b 命令

    MiniBufExplorer插件的使用 博客分类: vim vimMiniBufExplorer 快速浏览和操作Buffer -- 插件: MiniBufExplorer 下载地址 [http:// ...

  4. 第十二次作业psp

    psp 进度条 代码累积折线图 博文累积折线图 psp饼状图

  5. Classifier

    1.视频:https://morvanzhou.github.io/tutorials/machine-learning/keras/2-2-classifier/ 2.敲了代码,但是运行结果不懂,明 ...

  6. TeamWork#2,Week 5,Our Measurement of Contribution to the Team

    经过了今天下午将近两个小时的激烈讨论,我们最终确定了我们的团队贡献分的分配方式,这种方式是我们团队都能接受的. 我们的分配方式一定程度上借鉴了valve公司的队友评估原则,但是又不单单是这样.我们的分 ...

  7. First scrum meeting report - 151017

    提要 今天开会主要是讨论一下北航MOOC客户端的具体要求和每个人的大致分工.会议后来还简单商讨了一下我们app的大致界面框架. 会议地点:大运村KFC 会议时间:2015年10月17日,15:00-1 ...

  8. Servet3.0于Servlet2.5比较

    Servet3.0于Servlet2.5比较恢复 首先是利用注解代替配置文件 Servlet2.5利用配置文件对Servlet进行配置 例如这样 <servlet> <servlet ...

  9. 四则运算《《《《SQL出题

    设计思路: 这次要用数据库存储题目,我想到的是用SQL server数据库,用dataGridView控件读取数据. 具体实现: DBCon.cs 1 using System; 2 using Sy ...

  10. 【Coursera】基于朴素贝叶斯的中文多分类器

    一.算法说明 为了便于计算类条件概率\(P(x|c)\),朴素贝叶斯算法作了一个关键的假设:对已知类别,假设所有属性相互独立. 当使用训练完的特征向量对新样本进行测试时,由于概率是多个很小的相乘所得, ...