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. Centos7 zabbix 自动发现与注册

    自动发现与自动注册 自动发现: zabbix Server主动发现所有客户端,然后将客户端登记自己的小本上,缺点zabbix server压力山大(网段大,客户端多),时间消耗多. 自动注册: zab ...

  2. ES6----Proxy(一)

    Proxy 用于修改某些操作的默认行为,等同于在语言层面做出修改,所以属于一种“元编程”(meta programming),即对编程语言进行编程. 听起来好像很绕,可以简单这样理解,Proxy相当于 ...

  3. vue入门之单文件组件

    介绍 在很多 Vue 项目中,我们使用 Vue.component 来定义全局组件,紧接着用 new Vue({ el: '#container '}) 在每个页面内指定一个容器元素. 这种方式在很多 ...

  4. 必应词典手机版(IOS版)与有道词典(IOS版)之软件分析【功能篇】【用户体验篇】

    1.序言: 随着手机功能的不断更新和推广,手机应用市场的竞争变得愈发激烈.这次我们选择必应词典和有道词典的苹果客户端作对比,进一步分析这两款词典的客户端在功能和用户体验方面的利弊.这次测评的主要评测人 ...

  5. BugPhobia开发篇章:Scurm Meeting-更新至0x02

    0x01 :目录与摘要 If you weeped for the missing sunset, you would miss all the shining stars 索引 提纲 整理与更新记录 ...

  6. OO学习体会与阶段总结(设计与实现)

    前言   在最近的一个月的课程中,笔者对于规格化编程进行了深入的学习.运用面向对象抽象思想对编写的程序进行过程抽象.异常处理.数据抽象.类的层次规格与迭代等等规格设计,使得程序结构化程度提高,具有更好 ...

  7. AloneQIan---第一次作业

    小学生的噩梦 一.估计与实际 PSP2.1 Personal Software Process Stages 预估耗时(分钟) 实际耗时(分钟) Planning 计划 600 720 • Estim ...

  8. B3

    吴晓晖(组长) 过去两天完成了哪些任务 一些细节的debug,部分优化,算法中有关记录的部分 展示GitHub当日代码/文档签入记录 接下来的计划 推荐算法 还剩下哪些任务 组员:刘帅珍 过去两天完成 ...

  9. 【图论】POJ-3255 次短路径

    一.题目 Description Bessie has moved to a small farm and sometimes enjoys returning to visit one of her ...

  10. sql经常出现死锁解决办法

    文章:sql server在高并发状态下同时执行查询与更新操作时的死锁问题