Submission #70842681


Source Code Expand

#include <bits/stdc++.h>

#define endl '\n'
#define ll long long
#define db double

using namespace std;
const int M = 1e5 + 5;
//mt19937_64 rnd(time(0));

void sol() {
    int n, m, k;
    cin >> n >> m >> k;
    vector<int> h, b;
    for (int i = 0; i < n; i++) {
        int x;
        cin >> x;
        h.push_back(x);
    }
    for (int i = 0; i < m; i++) {
        int x;
        cin >> x;
        b.push_back(x);
    }
    sort(h.begin(), h.end());
    sort(b.begin(), b.end());
    int i = 0, j = 0;
    while (i < n && j < m) {
        if (h[i] <= b[j]) {
            i++, j++, k--;
        } else {
            j++;
        }
    }

    if (k <= 0) cout << "Yes" << endl;
    else cout << "No" << endl;
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int T = 1;
//    cin >> T;
    while (T--) sol();
}

Submission Info

Submission Time
Task C - Robot Factory
User wyzl
Language C++23 (GCC 15.2.0)
Score 300
Code Size 886 Byte
Status AC
Exec Time 46 ms
Memory 5748 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 3592 KiB
00_sample_01.txt AC 1 ms 3548 KiB
00_sample_02.txt AC 1 ms 3604 KiB
00_sample_03.txt AC 1 ms 3604 KiB
01_random_03.txt AC 45 ms 5612 KiB
01_random_04.txt AC 45 ms 5596 KiB
01_random_05.txt AC 45 ms 5716 KiB
01_random_06.txt AC 46 ms 5548 KiB
01_random_07.txt AC 46 ms 5668 KiB
01_random_08.txt AC 45 ms 5684 KiB
01_random_09.txt AC 45 ms 5600 KiB
01_random_10.txt AC 45 ms 5716 KiB
01_random_11.txt AC 45 ms 5660 KiB
01_random_12.txt AC 21 ms 4320 KiB
01_random_13.txt AC 22 ms 4772 KiB
01_random_14.txt AC 30 ms 4760 KiB
01_random_15.txt AC 13 ms 3892 KiB
01_random_16.txt AC 12 ms 4060 KiB
01_random_17.txt AC 14 ms 4060 KiB
01_random_18.txt AC 45 ms 5664 KiB
01_random_19.txt AC 46 ms 5680 KiB
01_random_20.txt AC 46 ms 5728 KiB
01_random_21.txt AC 46 ms 5748 KiB
01_random_22.txt AC 46 ms 5568 KiB
01_random_23.txt AC 21 ms 4688 KiB
01_random_24.txt AC 2 ms 3768 KiB
01_random_25.txt AC 44 ms 5592 KiB
01_random_26.txt AC 45 ms 5604 KiB
01_random_27.txt AC 46 ms 5664 KiB
01_random_28.txt AC 46 ms 5656 KiB
01_random_29.txt AC 45 ms 5684 KiB
01_random_30.txt AC 45 ms 5748 KiB
01_random_31.txt AC 28 ms 4656 KiB
01_random_32.txt AC 33 ms 5020 KiB
01_random_33.txt AC 32 ms 4996 KiB