Codeforces Round #317 [AimFund Thanks-Round] (Div. 2) Array 模拟
题目链接:http://codeforces.com/contest/572/problem/A
题意
就给你两个数组,问你能不能从A数组中取出k个,B数组中取出m个,使得这k个都大于这m个。
题解
就模拟
代码
#include<iostream>
#include<cstring>
#include<algorithm>
#define MAX_N 100005
using namespace std; int n0,n1;
int k,m;
int a[MAX_N],b[MAX_N]; int main(){
cin.sync_with_stdio(false);
cin>>n0>>n1;
cin>>k>>m;
for(int i=;i<n0;i++)cin>>a[i];
for(int i=;i<n1;i++)cin>>b[i];
int t=a[k-];
int p=;
while(p<n1&&b[p]<=t)p++;
if(n1-p>=m)cout<<"YES"<<endl;
else cout<<"NO"<<endl;
return ;
}
Codeforces Round #317 [AimFund Thanks-Round] (Div. 2) Array 模拟的更多相关文章
- Codeforces Round #317 [AimFund Thanks-Round] (Div. 2) Minimization dp
原题链接:http://codeforces.com/contest/572/problem/D 题意 给你个数组A和n,k,问你排列A后,下面的最小值是多少. 题解 先排个序,要填充像1,1+k,1 ...
- Codeforces Round #317 [AimFund Thanks-Round] (Div. 2) Order Book 模拟
原题链接:http://codeforces.com/contest/572/problem/B 题意 很迷,自行看题. 题解 看懂题就会做了 代码 #include<iostream> ...
- Codeforces Round #539Ȟȟȡ (Div. 1) 简要题解
Codeforces Round #539 (Div. 1) A. Sasha and a Bit of Relax description 给一个序列\(a_i\),求有多少长度为偶数的区间\([l ...
- Codeforces Round VK Cup 2015 - Round 1 (unofficial online mirror, Div. 1 only)E. The Art of Dealing with ATM 暴力出奇迹!
VK Cup 2015 - Round 1 (unofficial online mirror, Div. 1 only)E. The Art of Dealing with ATM Time Lim ...
- Codeforces Round #542 [Alex Lopashev Thanks-Round] (Div. 2) 题解
Codeforces Round #542 [Alex Lopashev Thanks-Round] (Div. 2) 题目链接:https://codeforces.com/contest/1130 ...
- 基于div表单模拟右对齐
基于div表单模拟右对齐 --------------------------------------------------------- ----------------------------- ...
- Codeforces Round #317 (div 2)
Problem A Arrays 思路:水一水. #include<bits/stdc++.h> using namespace std; ; int n1,n2,k,m,a[N],b[N ...
- Codeforces Round #317 (Div. 2) D Minimization (贪心+dp)
D. Minimization time limit per test 2 seconds memory limit per test 256 megabytes input standard ...
- Codeforces Round #317 (Div. 2) C Lengthening Sticks (组合,数学)
一个合法的三角形的充要条件是a<b+c,其中a为最长的一边,可以考虑找出所有不满足的情况然后用总方案减去不合法的情况. 对于一个给定的总长度tl(一定要分完,因为是枚举tl,不分配的长度已经考虑 ...
随机推荐
- LeetCode(307) Range Sum Query - Mutable
题目 Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclus ...
- 逃离迷宫 HDU - 1728(bfs)
逃离迷宫 Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submis ...
- 牛客网 Wannafly挑战赛21 灯塔
Z市是一座港口城市,来来往往的船只依靠灯塔指引方向.在海平面上,存在n个灯塔.每个灯塔可以照亮以它的中心点为中心的90°范围.特別地, 由于特殊限制,每个灯塔照亮范围的角的两条边必须要么与坐标轴平行要 ...
- acdsee 15中文版的许可证密钥+激活方法
按以下方法就可以使用了,进入注册表的命令是:开始-运行-输入regedit 进入注册表后按下面的步骤操作就行. ACDSee15中文版激活英文版激活码5NR9CW-SSRMMY-KFWMQU-ZP ...
- “万恶”的break
写这篇随笔主要是希望自己长点记性,break的作用是跳出当次循环,每次用break都有点忘记break后面的条件提前. 正常是这样: exit_flag=Falsefor i in range(10) ...
- TOJ4483: Common Digit Pairs
4483: Common Digit Pairs Time Limit(Common/Java):3000MS/9000MS Memory Limit:65536KByteTotal Sub ...
- TOJ4203: Domino Piece
4203: Domino Piece Time Limit(Common/Java):1000MS/3000MS Memory Limit:65536KByteTotal Submit: 5 ...
- HDU-2768 Cat vs. Dog
题意一开始是理解错的...结果就各种WA啦~ 对于两个观众,假如有某只宠物,一个人讨厌另一个人却喜欢,这两个人就是有矛盾的,连边. 最后求最小顶点覆盖.因为把这个覆盖点集去掉的话剩下的图中没有两个点是 ...
- cf359D Pair of Numbers
Simon has an array a1, a2, ..., an, consisting of n positive integers. Today Simon asked you to find ...
- 优化join语句
Mysql4.1开始支持SQL的子查询.这个技术可以使用SELECT语句来创建一个单列的查询结果,然后把这个结果作为过滤条件用在另一个查询中.使用子查询可以一次性的完成很多逻辑上需要多个步骤才能完成的 ...