58062023-10-02 17:21:34Lxllx13Vállalkozócpp11Runtime error 2/4032ms5500 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/03ms1808 KiB
2Runtime error0/032ms3124 KiB
3Wrong answer0/23ms2212 KiB
4Accepted2/23ms2428 KiB
5Wrong answer0/23ms2636 KiB
6Wrong answer0/23ms2752 KiB
7Wrong answer0/24ms2860 KiB
8Wrong answer0/23ms3016 KiB
9Wrong answer0/24ms3116 KiB
10Wrong answer0/23ms3440 KiB
11Wrong answer0/24ms3408 KiB
12Wrong answer0/23ms3500 KiB
13Wrong answer0/24ms3752 KiB
14Wrong answer0/24ms3956 KiB
15Wrong answer0/210ms4232 KiB
16Wrong answer0/210ms4360 KiB
17Runtime error0/216ms4860 KiB
18Wrong answer0/210ms4552 KiB
19Wrong answer0/213ms4584 KiB
20Runtime error0/217ms4764 KiB
21Runtime error0/224ms5052 KiB
22Runtime error0/232ms5500 KiB