58102023-10-02 17:34:51rx7Vállalkozócpp11Wrong answer 2/4034ms4652 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/03ms1808 KiB
2Wrong answer0/034ms2892 KiB
3Wrong answer0/23ms2344 KiB
4Wrong answer0/23ms2560 KiB
5Accepted2/23ms2748 KiB
6Wrong answer0/24ms2984 KiB
7Wrong answer0/24ms3276 KiB
8Wrong answer0/23ms3156 KiB
9Wrong answer0/24ms3176 KiB
10Wrong answer0/23ms3288 KiB
11Wrong answer0/24ms3384 KiB
12Wrong answer0/24ms3388 KiB
13Wrong answer0/24ms3408 KiB
14Wrong answer0/24ms3648 KiB
15Wrong answer0/210ms3844 KiB
16Wrong answer0/210ms3896 KiB
17Wrong answer0/216ms4068 KiB
18Wrong answer0/210ms4000 KiB
19Wrong answer0/213ms4176 KiB
20Wrong answer0/217ms4004 KiB
21Wrong answer0/224ms4348 KiB
22Wrong answer0/234ms4652 KiB