Educational Codeforces Round 27 A

题意:让你从2*n个数,选n个,问是否会和另外n个1V1比赛,每场都赢,只有大于才赢

思路:标记下即可

http://codeforces.com/contest/845/problem/A

 1 #include<bits/stdc++.h>
 2 using namespace std;
 3 const int N=202;
 4 
 5 int a[N];
 6 map<int ,int >ma;
 7 int main(){
 8     int n;
 9     cin>>n;
10     for(int i=1;i<=2*n;i++) scanf("%d",&a[i]);
11     sort(a+1,a+1+n*2);
12     for(int i=1;i<=n;i++) ma[a[i]]++;
13     for(int i=n+1;i<=2*n;i++){
14         if(ma[a[i]]) {
15             cout<<"NO"<<endl;return 0;
16         }
17     }
18     cout<<"YES"<<endl;
19     return 0;
20 }

 

posted on 2017-08-23 15:45  hhhhx  阅读(91)  评论(0编辑  收藏  举报

导航