# Codeforces Round #331 (Div. 2)——C. Wilbur and Points

MD，又因为一个傻逼错误搞了一个下午+一个晚上。。忧桑= =

#include<cstdio>
#include<cstring>
#include<map>
#include<set>
#include<cmath>
#include<algorithm>
#include<vector>
#include<queue>
#include<iostream>
using namespace std;
typedef __int64 ll;
typedef unsigned __int64 ULL;
#define inf 99999999
#define maxn 200022
int w[maxn];
struct node{
int x,y;
int idx;
node(){}
node(int xx,int yy){
x=xx;
y=yy;
}
friend bool operator <(node a,node b){
if(a.x!=b.x) return a.x<b.x;
else return a.y<b.y;
}
};
map<int,int> mp;
set<node> st[maxn];
set<node>::iterator it;
vector<int> dian[maxn];
vector<int> ans[maxn];
pair<int,int> par[maxn];
int main(){
int n;
scanf("%d",&n);
for(int i=1;i<=n;i++){
int x,y;
scanf("%d%d",&x,&y);
}
for(int i=1;i<=n;i++){
scanf("%d",&w[i]);
}
for(int i=1;i<=n;i++){
printf("NO\n");
return 0;
}
}
node tmp;
for(int i=1;i<=n;i++){
tmp=*it;
int xx=(*it).x,yy=(*it).y;
par[idx]=make_pair(xx,yy);
ans[xx].push_back(yy);
int len=ans[xx].size()-1;
ans[xx][len]=idx;
}
for(int i=0;i<100010;i++){
for(int j=0;j<ans[i].size();j++){
if(ans[i+1].size()>j&&ans[i+1][j]<ans[i][j]){
printf("NO\n");
return 0;
}
if(j+1<ans[i].size()&&ans[i][j]>ans[i][j+1]){
printf("NO\n");
return 0;
}
}
}
printf("YES\n");
for(int i=1;i<=n;i++){
printf("%d %d\n",par[i].first,par[i].second);
}
return 0;
}
/*
9
0 0
1 0
2 0
0 1
1 1
2 1
1 2
2 2
0 2
0 0 0 -1 -1 -2 1 1 2
*/


#### Codeforces Round #471 div.2 ABC题解

2018-03-24 14:16:58

#### Codeforces Round #482 (Div. 2)

2018-05-15 12:51:24

#### Codeforces Round #495 (Div. 2) C. Sonya and Robots（模拟）

2018-07-07 15:36:24

#### Tinkoff Internship Warmup Round 2018 and Codeforces Round #475 (Div. 2) C. Alternating Sum

2018-04-18 11:14:58

#### C. DNA Alignment(Codeforces Round #295(div2))

2015-03-02 18:27:17

#### Codeforces Round #448 (Div. 2) ABC

2017-11-27 14:47:02

#### Codeforces Round #459 (Div. 2)The Monster[匹配问题]

2018-01-30 15:20:19

#### Codeforces Round #475 (Div. 2) C. Alternating Sum

2018-04-20 16:38:22

#### Codeforces Round #444 (Div. 2)-贪心&尺取-Ratings and Reality Shows

2017-11-11 20:11:11

#### Codeforces Round #481 (Div. 3) 全题解

2018-05-14 17:30:18