58022023-10-02 15:40:42lacitoVállalkozócpp17Wrong answer 38/4037ms7300 KiB
#include <bits/stdc++.h>
using namespace std;

int main() {
	int n, m;
	cin >> n >> m;
	vector<int> hatarido(m), ora_nap(24 * n); // ora_nap[i]: az i-edik ora melyik napon van
	int ora_i = 0;
	for (int nap = 1; nap <= n; nap++) {
		int orak;
		cin >> orak;
		for (int j = 0; j < orak; j++) {
			ora_nap[ora_i++] = nap;
		}
	}
	for (int i = 0; i < m; i++) cin >> hatarido[i];
	sort(hatarido.begin(), hatarido.end());

	ora_i = 0; // elso szabad
	int mo = 0;
	for (int h : hatarido) {
		if (h >= ora_nap[ora_i]) {
			mo++;
			ora_i++;
		}
	}
	cout << mo << endl;
}
SubtaskSumTestVerdictTimeMemory
base38/40
1Accepted0/03ms1808 KiB
2Accepted0/034ms3068 KiB
3Wrong answer0/23ms2492 KiB
4Accepted2/22ms2580 KiB
5Accepted2/23ms2712 KiB
6Accepted2/23ms3072 KiB
7Accepted2/24ms3344 KiB
8Accepted2/23ms3532 KiB
9Accepted2/24ms3788 KiB
10Accepted2/23ms3752 KiB
11Accepted2/24ms3772 KiB
12Accepted2/24ms3868 KiB
13Accepted2/24ms4104 KiB
14Accepted2/24ms4236 KiB
15Accepted2/212ms4648 KiB
16Accepted2/212ms5028 KiB
17Accepted2/216ms6944 KiB
18Accepted2/212ms7016 KiB
19Accepted2/214ms7300 KiB
20Accepted2/217ms5772 KiB
21Accepted2/225ms6456 KiB
22Accepted2/237ms7112 KiB