58112023-10-02 17:34:57Lxllx13Vállalkozócpp17Wrong answer 2/4034ms5480 KiB
#include <bits/stdc++.h>
using namespace std;

int main() {
	int nap, munka;
	cin>>nap>>munka;
	vector<int> maxi(nap);
	vector<int>ora;
	for(int i=0; i<nap; i++){
		cin>>maxi[i];
		for(int j=0; j<maxi[i];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++){
		for(int j=0; j<nap; i++){
			if(hat[i]>=maxi[j]){
				maxi[j]--;
				ans++;
				break;
			}
		}
	}
	cout<<ans<<"\n";
	return 0;
}
SubtaskSumTestVerdictTimeMemory
base2/40
1Accepted0/03ms1812 KiB
2Wrong answer0/034ms2888 KiB
3Wrong answer0/22ms2136 KiB
4Wrong answer0/22ms2264 KiB
5Accepted2/23ms2480 KiB
6Wrong answer0/23ms2744 KiB
7Wrong answer0/24ms3128 KiB
8Wrong answer0/23ms3196 KiB
9Wrong answer0/24ms3284 KiB
10Wrong answer0/23ms3268 KiB
11Wrong answer0/24ms3404 KiB
12Wrong answer0/24ms3532 KiB
13Wrong answer0/24ms3400 KiB
14Wrong answer0/24ms3644 KiB
15Wrong answer0/210ms3972 KiB
16Wrong answer0/212ms4180 KiB
17Wrong answer0/216ms4404 KiB
18Wrong answer0/210ms4464 KiB
19Wrong answer0/214ms4712 KiB
20Wrong answer0/217ms4652 KiB
21Wrong answer0/225ms4904 KiB
22Wrong answer0/234ms5480 KiB