Submission #70771357


Source Code Expand

#include <bits/stdc++.h>
#ifdef LOCAL
#include "debug.h"
#else
#define dbg(...) 0
#endif
using namespace std;
using ll = long long;
using db = double;
const ll N = 1e6 + 5;
const ll md = 998244353;
const ll MOD = 1e9 + 7;
const ll INF = 0x3f3f3f3f3f3f3f;
const db PI = acos(-1);
const db eps = 1e-6;
const db E = 2.718281828459045;
typedef pair<ll, ll> PLL;
#define fi first
#define se second
ll a[N], b[N];
void solve()
{
    ll n, m, k;
    cin >> n >> m >> k;
    for (ll i = 1; i <= n;i++)
        cin >> a[i];
    for (ll i = 1; i <= m;i++)
        cin >> b[i];
    sort(a + 1, a + 1 + n);
    sort(b + 1, b + 1 + m);
    ll cnt = 0;
    ll j = 1;
    for (ll i = 1; i <= n;i++)
    {
        while(j<=m&&b[j]<a[i])
            j++;
        if(j<=m)
        {
            cnt++;
            j++;
        }
    }
    if(cnt>=k)
        cout << "Yes\n";
    else
        cout << "No\n";
}
int main()
{
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    int T;
    T = 1;
    //cin>>T;
    while (T--)
    {
        solve();
    }
}

Submission Info

Submission Time
Task C - Robot Factory
User AChievedreaM
Language C++23 (GCC 15.2.0)
Score 300
Code Size 1098 Byte
Status AC
Exec Time 40 ms
Memory 6804 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 4
AC × 35
Set Name Test Cases
Sample 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt
All 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt, 01_random_07.txt, 01_random_08.txt, 01_random_09.txt, 01_random_10.txt, 01_random_11.txt, 01_random_12.txt, 01_random_13.txt, 01_random_14.txt, 01_random_15.txt, 01_random_16.txt, 01_random_17.txt, 01_random_18.txt, 01_random_19.txt, 01_random_20.txt, 01_random_21.txt, 01_random_22.txt, 01_random_23.txt, 01_random_24.txt, 01_random_25.txt, 01_random_26.txt, 01_random_27.txt, 01_random_28.txt, 01_random_29.txt, 01_random_30.txt, 01_random_31.txt, 01_random_32.txt, 01_random_33.txt
Case Name Status Exec Time Memory
00_sample_00.txt AC 1 ms 3636 KiB
00_sample_01.txt AC 1 ms 3524 KiB
00_sample_02.txt AC 1 ms 3484 KiB
00_sample_03.txt AC 1 ms 3548 KiB
01_random_03.txt AC 40 ms 6716 KiB
01_random_04.txt AC 40 ms 6672 KiB
01_random_05.txt AC 40 ms 6748 KiB
01_random_06.txt AC 39 ms 6748 KiB
01_random_07.txt AC 39 ms 6712 KiB
01_random_08.txt AC 39 ms 6716 KiB
01_random_09.txt AC 40 ms 6748 KiB
01_random_10.txt AC 39 ms 6644 KiB
01_random_11.txt AC 40 ms 6764 KiB
01_random_12.txt AC 18 ms 5100 KiB
01_random_13.txt AC 19 ms 5056 KiB
01_random_14.txt AC 26 ms 5596 KiB
01_random_15.txt AC 12 ms 4380 KiB
01_random_16.txt AC 10 ms 4444 KiB
01_random_17.txt AC 12 ms 4588 KiB
01_random_18.txt AC 39 ms 6764 KiB
01_random_19.txt AC 39 ms 6688 KiB
01_random_20.txt AC 39 ms 6636 KiB
01_random_21.txt AC 40 ms 6688 KiB
01_random_22.txt AC 40 ms 6688 KiB
01_random_23.txt AC 19 ms 5020 KiB
01_random_24.txt AC 2 ms 3692 KiB
01_random_25.txt AC 38 ms 6496 KiB
01_random_26.txt AC 39 ms 6804 KiB
01_random_27.txt AC 40 ms 6784 KiB
01_random_28.txt AC 39 ms 6748 KiB
01_random_29.txt AC 39 ms 6748 KiB
01_random_30.txt AC 39 ms 6764 KiB
01_random_31.txt AC 25 ms 5632 KiB
01_random_32.txt AC 29 ms 5940 KiB
01_random_33.txt AC 28 ms 5852 KiB