58072023-10-02 17:21:54Lxllx13Vállalkozócpp17Runtime error 2/4034ms5420 KiB
#include <bits/stdc++.h>
using namespace std;

int main() {
	int nap, munka;
	cin>>nap>>munka;
	int a;
	vector<int>ora;
	for(int i=0; i<nap; i++){
		cin>>a;
		for(int j=0; j<a;j++){
			ora.push_back(i+1);
		}
	}
	vector<int> hat(munka);
	for(int i=0; i<munka; i++){
		cin>>hat[i];
	}
	int ans=0;
	sort(hat.begin(),hat.end());
	
	for(int i=0; i<hat.size(); i++){
		if(hat[i]>=ora[i]){
			ans++;
		}
	}
	cout<<ans<<"\n";
	return 0;
}
SubtaskSumTestVerdictTimeMemory
base2/40
1Accepted0/03ms1812 KiB
2Runtime error0/032ms3116 KiB
3Wrong answer0/23ms2216 KiB
4Accepted2/23ms2464 KiB
5Wrong answer0/23ms2776 KiB
6Wrong answer0/23ms2884 KiB
7Wrong answer0/24ms3172 KiB
8Wrong answer0/23ms3500 KiB
9Wrong answer0/24ms3640 KiB
10Wrong answer0/23ms3708 KiB
11Wrong answer0/23ms3556 KiB
12Wrong answer0/24ms3744 KiB
13Wrong answer0/24ms3844 KiB
14Wrong answer0/24ms3968 KiB
15Wrong answer0/210ms4276 KiB
16Wrong answer0/210ms4276 KiB
17Runtime error0/216ms4528 KiB
18Wrong answer0/210ms4588 KiB
19Wrong answer0/213ms4580 KiB
20Runtime error0/217ms5012 KiB
21Runtime error0/224ms5224 KiB
22Runtime error0/234ms5420 KiB