Codeforces Round #245 (Div. 2) A - Points and Segments (easy)
水到家了
#include <iostream>
#include <vector>
#include <algorithm> using namespace std; struct Point{
int index, pos;
Point(int index_ = , int pos_ = ){
index = index_;
pos = pos_;
} bool operator < (const Point& a) const{
return pos < a.pos;
}
}; int main(){
int n,m, l,r;
cin >> n >> m;
vector<Point> points(n);
for(int i = ; i < n ; ++ i){
cin >> points[i].pos;
points[i].index = i;
}
sort(points.begin(),points.end());
for(int i = ; i < m; ++ i) cin >> l >> r;
vector<int> res(n,);
for(int i = ; i < n ; ++ i ){
if(i% == ) res[points[i].index] =;
}
cout<<res[];
for(int i = ; i <n ; ++ i ) cout<<" "<<res[i];
cout<<endl; }
Codeforces Round #245 (Div. 2) A - Points and Segments (easy)的更多相关文章
- Codeforces Round #245 (Div. 2) A. Points and Segments (easy) 贪心
A. Points and Segments (easy) Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/con ...
- Codeforces Round #501 (Div. 3) 1015A Points in Segments (前缀和)
A. Points in Segments time limit per test 1 second memory limit per test 256 megabytes input standar ...
- Codeforces Round #486 (Div. 3) D. Points and Powers of Two
Codeforces Round #486 (Div. 3) D. Points and Powers of Two 题目连接: http://codeforces.com/group/T0ITBvo ...
- Codeforces Round #245 (Div. 2)
版权声明:本文为博主原创文章,未经博主同意不得转载. https://blog.csdn.net/yew1eb/article/details/25609981 A Points and Segmen ...
- Codeforces Round #466 (Div. 2) -A. Points on the line
2018-02-25 http://codeforces.com/contest/940/problem/A A. Points on the line time limit per test 1 s ...
- Codeforces Round #319 (Div. 1) C. Points on Plane 分块
C. Points on Plane Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/576/pro ...
- Codeforces Round #466 (Div. 2) A. Points on the line[数轴上有n个点,问最少去掉多少个点才能使剩下的点的最大距离为不超过k。]
A. Points on the line time limit per test 1 second memory limit per test 256 megabytes input standar ...
- Codeforces Round #245 (Div. 1) 429D - Tricky Function 最近点对
D. Tricky Function Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 codeforces.com/problemset/problem/42 ...
- Codeforces Round #245 (Div. 1) B. Working out (简单DP)
题目链接:http://codeforces.com/problemset/problem/429/B 给你一个矩阵,一个人从(1, 1) ->(n, m),只能向下或者向右: 一个人从(n, ...
随机推荐
- js 删除确定
"<td><a href='shanchu.php?c={$v[0]}' onclick=\"return confirm('确定删除么?')\"> ...
- smarty汇总
Smarty:模板技术 实现功能:前后分离. 原理:主要通过Smarty核心类实现,调用display方法,将模板文件读取,用正则进行替换,替换完保存到临时文 件,将临时文件加载到当前页面. 配置文件 ...
- 查看当前文件系统 df -lhT -B G
[root@ok-T test]# df -lhT -B G Filesystem Type 1G-blocks Used Available Use% Mounted on /dev/mapper/ ...
- CSS3学习
1.CSS3边框 border-radius:创建圆角边框 border-radius:25px; -moz-border-radius:25px; /* 老的 Firefox */ box-shad ...
- 比较各大挪动门户网站淘宝、京东、网易、新浪、腾讯meta标签的异同
首先先展示一下各个网站的有关meta标签的代码: 网易 <meta charset="UTF-8"> <meta content="width=devi ...
- jQuery ajax同步的替换方法,使用 $.Deferred()对象
function aa() { var defer = $.Deferred(); $.ajax({ url: "/Handler1.ashx", type: "post ...
- 【JAVA集合框架之List】
一.List接口概述. List有个很大的特点就是可以操作角标. 下面开始介绍List接口中相对于Collection接口比较特别的方法.在Collection接口中已经介绍的方法此处就不再赘述. 1 ...
- 使用Asyncio的Coroutine来实现一个有限状态机
如图: #!/usr/bin/env python # -*- coding: utf-8 -*- import asyncio import datetime import time from ra ...
- 【openGL】四面体
- 浅谈config文件的使用
一.缘起 最近做项目开始使用C#,因为以前一直使用的是C++,因此面向对象思想方面的知识还是比较全面的,反而是因没有经过完整.系统的.Net方面知识的系统学习,经常被一些在C#老鸟眼里几乎是常识的小知 ...