比赛 2024暑期C班集训2 评测结果 WAWAAWAAAA
题目名称 筹办模拟赛 最终得分 70
用户昵称 彭欣越 运行时间 0.000 s
代码语言 C++ 内存使用 0.00 MiB
提交时间 2024-07-02 08:48:29
显示代码纯文本
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=110;
ll a[N],b[N];
int n,cnt;
int main () {
    freopen("proposal.in","r",stdin);
    freopen("proposal.out","w",stdout);
    scanf("%d",&n);
    for (int i=1;i<=n;i++) scanf("%lld",&a[i]);
    for (int i=1;i<=n;i++) scanf("%lld",&b[i]);
    for (int i=1;i<=n;i++) {
        if (i+cnt>n) break;
        while (a[i]>b[i+cnt]) cnt++;
    }
    printf("%d",cnt);
    return 0;
}