zoukankan      html  css  js  c++  java
  • 题解 CF387B 【George and Round】

    题目大家都理解清楚了吧

    其实就是尽量多用已有的题,就要求对自己的题按复杂度由低到高排序,从头到尾遍历,用贪心。排序为了便于比较。然后就是只要普通的遍历枚举就可以辣~

    #include <iostream>
    #include <cstdio>
    #include <algorithm>
    #include <cmath>
    #include <cstring>
    #include <cctype>
    #include <vector>
    #include <queue>
    #include <stack>//头文件(管理都不用万能我为神马要用万能)
    using namespace std;
    int n,m,a[1000005],b[1000005],l,r;//不要被这个空间吓着了,放心,不会炸
    using namespace std;
    inline int read()
    {
        int x=0,f=1;char ch=getchar();
        while (!isdigit(ch)){if (ch=='-') f=-1;ch=getchar();}
        while (isdigit(ch)){x=x*10+ch-48;ch=getchar();}
        return x*f;
    }//快读(cz专用模板)
    int main(){
        n=read(),m=read();
        for(int i=0;i<n;i++)
            a[i]=read();
        for(int i=0;i<m;i++)
            b[i]=read();//输入部分就不详细讲了
        sort(a,a+n);
        sort(b,b+m);//排序,以便后头进行比较分析
        while(l<n&&r<m){//遍历枚举
            if(a[l]<=b[r])
                l++; 
            r++;
        }
        cout<<n-l<<endl;//最后输出掉
        return 0;
    }
     
  • 相关阅读:
    fiddler模拟弱网测试环境
    3.12 获取地址定位
    3.11 第一次个人作业7
    3.10 第一次个人作业6
    3.9 第一次个人作业5
    3.8 第一次个人作业4
    3.7 第一个次个人作业3
    3.6 第一次个人作业2
    3.5 第一次个人作业
    3.4 TextClock的基本使用
  • 原文地址:https://www.cnblogs.com/Sworddust/p/11615280.html
Copyright © 2011-2022 走看看