Codeforces Round #203 (Div. 2)A
来源:互联网 发布:跟美团众包类似软件 编辑:程序博客网 时间:2024/06/07 04:54
WA了几次还。。。
#include<iostream>#include<set>#include<map>#include<vector>#include<queue>#include<cmath>#include<climits>#include<cstdio>#include<string>#include<cstring>#include<algorithm>typedef long long LL;using namespace std;int n,m;int righ[110],wrong[110],twice[110];int main(){ //freopen("in.txt","r",stdin); while(cin>>n>>m) { for(int i=0;i<n;i++) { cin>>righ[i]; twice[i]=2*righ[i]; } for(int i=0;i<m;i++) cin>>wrong[i]; sort(righ,righ+n); sort(twice,twice+n); sort(wrong,wrong+m); int ans=max(righ[n-1],twice[0]); if(ans>=wrong[0]) { cout<<-1<<endl; continue; } cout<<ans<<endl; } return 0;}
- Codeforces Round #203 (Div. 2) A. TL
- Codeforces Round #203 (Div. 2)A
- Codeforces Round #131 (Div. 2) A B
- Codeforces Round #174 (Div. 2) Problem A
- Codeforces Round #173 (Div. 2) A.Bit++
- Codeforces Round #181 (Div. 2) A题
- Codeforces Round #184 (Div. 2) A题
- Codeforces Round #185 (Div. 2)--A,B
- Codeforces Round #172 (Div. 2) A题
- Codeforces Round #166 (Div. 2) A题
- Codeforces Round #132 (Div. 2) A题
- Codeforces Round #131 (Div. 2) A题
- Codeforces Round #133 (Div. 2) A题
- Codeforces Round #137 (Div. 2) A题
- Codeforces Round #138 (Div. 2) A题
- Codeforces Round #147 (Div. 2) A题
- Codeforces Round #141 (Div. 2) A题
- Codeforces Round #143 (Div. 2) A题
- Winsock简介
- HDU-3191 How Many Paths Are There 次最短路
- C++ new/delete 重载
- Timer
- springMVC中在过滤器中使用spring bean
- Codeforces Round #203 (Div. 2)A
- 与系统music同步播放器Demo
- set -o vi
- win7 隐藏驱动编译于安装
- HDU1853 Cyclic Tour KM算法 模版题
- 利用alias,简化grunt配置文件
- 专业学习小成果
- 近期C程序小结
- android四大组件之 ContentProvider