Submission #70778781


Source Code Expand

#include<bits/stdc++.h>

using namespace std;
typedef long long ll;

#define FAST ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define mp make_pair
#define pb push_back
#define lp(i,s,f) for(ll i = s; i < ll(f); i++)
#define inF freopen("input.in", "r", stdin);
#define outF freopen("output.in", "w", stdout);
#define endl '\n'
#define MOD 1000000007
#define mm(arr) memset(arr, 0, sizeof(arr))
#define F first
#define S second


int32_t main(){
    FAST
    int n, m, k; cin >> n >> m >> k;
    int h[n], b[m];
    for(int i = 0; i < n; i++){
        cin >> h[i];
    }
    sort(h, h + n);
    for(int i = 0; i < m; i++){
        cin >> b[i];
    }
    sort(b, b + m);
    int can = 0;
    int i = 0, j = 0;
    while(i < n && j < m){
        if(h[i] <= b[j]){
            i++;
            j++;
            can++;
        }
        else{
            j++;
        }
    }
    if(can >= k){
        cout << "Yes";
    }
    else{
        cout << "No";
    }
    return 0;
}

Submission Info

Submission Time
Task C - Robot Factory
User Basilhijaz
Language C++23 (Clang 21.1.0)
Score 300
Code Size 1037 Byte
Status AC
Exec Time 171 ms
Memory 4640 KiB

Compile Error

./Main.cpp:22:11: warning: variable length arrays in C++ are a Clang extension [-Wvla-cxx-extension]
   22 |     int h[n], b[m];
      |           ^
./Main.cpp:22:11: note: read of non-const variable 'n' is not allowed in a constant expression
./Main.cpp:21:9: note: declared here
   21 |     int n, m, k; cin >> n >> m >> k;
      |         ^
./Main.cpp:22:17: warning: variable length arrays in C++ are a Clang extension [-Wvla-cxx-extension]
   22 |     int h[n], b[m];
      |                 ^
./Main.cpp:22:17: note: read of non-const variable 'm' is not allowed in a constant expression
./Main.cpp:21:12: note: declared here
   21 |     int n, m, k; cin >> n >> m >> k;
      |            ^
2 warnings generated.

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 2960 KiB
00_sample_01.txt AC 1 ms 2888 KiB
00_sample_02.txt AC 1 ms 2968 KiB
00_sample_03.txt AC 1 ms 3056 KiB
01_random_03.txt AC 165 ms 4404 KiB
01_random_04.txt AC 164 ms 4508 KiB
01_random_05.txt AC 163 ms 4592 KiB
01_random_06.txt AC 164 ms 4536 KiB
01_random_07.txt AC 165 ms 4416 KiB
01_random_08.txt AC 166 ms 4640 KiB
01_random_09.txt AC 170 ms 4584 KiB
01_random_10.txt AC 168 ms 4404 KiB
01_random_11.txt AC 165 ms 4584 KiB
01_random_12.txt AC 76 ms 3744 KiB
01_random_13.txt AC 79 ms 3704 KiB
01_random_14.txt AC 108 ms 3912 KiB
01_random_15.txt AC 47 ms 3448 KiB
01_random_16.txt AC 42 ms 3352 KiB
01_random_17.txt AC 51 ms 3560 KiB
01_random_18.txt AC 163 ms 4536 KiB
01_random_19.txt AC 163 ms 4608 KiB
01_random_20.txt AC 168 ms 4504 KiB
01_random_21.txt AC 171 ms 4584 KiB
01_random_22.txt AC 167 ms 4584 KiB
01_random_23.txt AC 77 ms 3740 KiB
01_random_24.txt AC 6 ms 3096 KiB
01_random_25.txt AC 154 ms 4584 KiB
01_random_26.txt AC 160 ms 4420 KiB
01_random_27.txt AC 163 ms 4416 KiB
01_random_28.txt AC 164 ms 4472 KiB
01_random_29.txt AC 160 ms 4536 KiB
01_random_30.txt AC 162 ms 4424 KiB
01_random_31.txt AC 108 ms 4024 KiB
01_random_32.txt AC 121 ms 4112 KiB
01_random_33.txt AC 118 ms 4152 KiB