题目链接: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 模拟的更多相关文章

  1. 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 ...

  2. Codeforces Round #317 [AimFund Thanks-Round] (Div. 2) Order Book 模拟

    原题链接:http://codeforces.com/contest/572/problem/B 题意 很迷,自行看题. 题解 看懂题就会做了 代码 #include<iostream> ...

  3. Codeforces Round #539&#542&#543&#545 (Div. 1) 简要题解

    Codeforces Round #539 (Div. 1) A. Sasha and a Bit of Relax description 给一个序列\(a_i\),求有多少长度为偶数的区间\([l ...

  4. 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 ...

  5. Codeforces Round #542 [Alex Lopashev Thanks-Round] (Div. 2) 题解

    Codeforces Round #542 [Alex Lopashev Thanks-Round] (Div. 2) 题目链接:https://codeforces.com/contest/1130 ...

  6. 基于div表单模拟右对齐

    基于div表单模拟右对齐 --------------------------------------------------------- ----------------------------- ...

  7. Codeforces Round #317 (div 2)

    Problem A Arrays 思路:水一水. #include<bits/stdc++.h> using namespace std; ; int n1,n2,k,m,a[N],b[N ...

  8. Codeforces Round #317 (Div. 2) D Minimization (贪心+dp)

    D. Minimization time limit per test  2 seconds memory limit per test  256 megabytes input  standard ...

  9. Codeforces Round #317 (Div. 2) C Lengthening Sticks (组合,数学)

    一个合法的三角形的充要条件是a<b+c,其中a为最长的一边,可以考虑找出所有不满足的情况然后用总方案减去不合法的情况. 对于一个给定的总长度tl(一定要分完,因为是枚举tl,不分配的长度已经考虑 ...

随机推荐

  1. Yii2.0 的安装学习

    视频学习地址: 后盾网视频: http://www.houdunren.com/houdunren18_lesson_76?vid=7350 与<Yii框架>不得不说的故事—基础篇 htt ...

  2. str 方法总结整理

    #!/usr/bin/env python #Python 3.7.0 字符串常用方法 __author__ = "lrtao2010" #capitalize 将字符串的首字符改 ...

  3. 线段树: CDOJ1598-加帕里公园的friends(区间合并,单点更新)

    加帕里公园的friends Time Limit: 3000/1000MS (Java/Others) Memory Limit: 131072/131072KB (Java/Others) 我还有很 ...

  4. OpenSSL version mismatch. Built against 1000105f, you have 10001060

    http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=732940 http://ftp.debian.org/debian/pool/main/o/ope ...

  5. 1036: [ZJOI2008]树的统计Count(树链剖分)

    1036: [ZJOI2008]树的统计Count Time Limit: 10 Sec  Memory Limit: 162 MBSubmit: 19830  Solved: 8067[Submit ...

  6. JAVA 基础--开发环境 vscode 搭建

    对于使用 Visual Studio Code 的 Java 开发者来说,Language Support for Java(TM) by Red Hat 扩展提供了非常好的语言特性支持,比如智能感知 ...

  7. Flask_配置文件

    flask中的配置文件是一个flask.config.Config对象(继承字典),默认配置为: default_config = ImmutableDict({ 'DEBUG': get_debug ...

  8. python学习-- 默认urls中 Path converter

    默认Path converter Django2.0自带的PathConveter包括: str:匹配除了路径分隔符(/)之外的非空字符串,如果没有转换器,默认使用str作为转换器. int:匹配0及 ...

  9. Leetcode 467.环绕字符串中的唯一子字符串

    环绕字符串中的唯一子字符串 把字符串 s 看作是"abcdefghijklmnopqrstuvwxyz"的无限环绕字符串,所以 s 看起来是这样的:"...zabcdef ...

  10. LaTeX Hierarchical Tables

    本系列文章由 @yhl_leo 出品,转载请注明出处. 文章链接: http://blog.csdn.net/yhl_leo/article/details/52692655 简单整理一下表格中的分级 ...