Submission #70774388


Source Code Expand

#include <bits/stdc++.h>
using namespace std;
#define int long long
signed main() {
    ios::sync_with_stdio(false); cin.tie(0);
    int n,m,k;
    cin>>n>>m>>k;
    vector<int>a(n,0);
    vector<int>b(m,0);
    for(int i=0;i<n;i++){
		cin>>a[i];
	}
    for(int i=0;i<m;i++){
		cin>>b[i];
	}
	sort(a.begin(),a.end());
	sort(b.begin(),b.end());
	int ans=0;
	int i=a.size()-1;int j=b.size()-1;
	while(i>=0&&j>=0){
		if(a[i]<=b[j]){
			ans++;
			i--;
			j--;
		}
		else{
			i--;
		}
	}
	if(ans>=k)cout<<"Yes"<<"\n";
	else cout<<"No"<<"\n";
    return 0;
}

Submission Info

Submission Time
Task C - Robot Factory
User fireskybaby
Language C++23 (GCC 15.2.0)
Score 300
Code Size 586 Byte
Status AC
Exec Time 50 ms
Memory 6520 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 3548 KiB
00_sample_01.txt AC 1 ms 3568 KiB
00_sample_02.txt AC 1 ms 3412 KiB
00_sample_03.txt AC 1 ms 3524 KiB
01_random_03.txt AC 40 ms 6464 KiB
01_random_04.txt AC 40 ms 6332 KiB
01_random_05.txt AC 40 ms 6440 KiB
01_random_06.txt AC 40 ms 6460 KiB
01_random_07.txt AC 41 ms 6520 KiB
01_random_08.txt AC 40 ms 6480 KiB
01_random_09.txt AC 40 ms 6488 KiB
01_random_10.txt AC 40 ms 6520 KiB
01_random_11.txt AC 41 ms 6460 KiB
01_random_12.txt AC 18 ms 4792 KiB
01_random_13.txt AC 19 ms 4704 KiB
01_random_14.txt AC 26 ms 5440 KiB
01_random_15.txt AC 12 ms 4152 KiB
01_random_16.txt AC 11 ms 4216 KiB
01_random_17.txt AC 13 ms 4264 KiB
01_random_18.txt AC 40 ms 6440 KiB
01_random_19.txt AC 41 ms 6368 KiB
01_random_20.txt AC 41 ms 6448 KiB
01_random_21.txt AC 41 ms 6452 KiB
01_random_22.txt AC 40 ms 6440 KiB
01_random_23.txt AC 19 ms 4780 KiB
01_random_24.txt AC 2 ms 3696 KiB
01_random_25.txt AC 45 ms 6204 KiB
01_random_26.txt AC 46 ms 6400 KiB
01_random_27.txt AC 50 ms 6448 KiB
01_random_28.txt AC 49 ms 6448 KiB
01_random_29.txt AC 40 ms 6520 KiB
01_random_30.txt AC 40 ms 6464 KiB
01_random_31.txt AC 25 ms 5292 KiB
01_random_32.txt AC 29 ms 5544 KiB
01_random_33.txt AC 29 ms 5544 KiB