2122021-02-07 22:52:44kovacs.peter.18fZenehallgatáscpp11Accepted 50/5078ms11052 KiB
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main() {
	cin.sync_with_stdio(false);
	cin.tie(nullptr);

	int N, K;
	cin >> N >> K;
	vector<int> songS(N);
	cin >> songS[0];
	for (int i = 1; i < N; i++) {
		cin >> songS[i];
		songS[i] += songS[i - 1];
	}
	vector<int> timeS(K);
	for (int i = 0; i < K; i++) {
		int k;
		cin >> k;
		cout << lower_bound(songS.begin(), songS.end(), k % songS[N - 1]) - songS.begin() + 1 << " ";
	}
}
SubtaskSumTestVerdictTimeMemory
base50/50
1Accepted0/02ms1760 KiB
2Accepted0/046ms4712 KiB
3Accepted2/21ms3304 KiB
4Accepted2/22ms3316 KiB
5Accepted2/22ms3332 KiB
6Accepted3/32ms3348 KiB
7Accepted3/32ms3360 KiB
8Accepted3/31ms3376 KiB
9Accepted2/248ms6184 KiB
10Accepted2/254ms7640 KiB
11Accepted2/278ms8372 KiB
12Accepted2/264ms8788 KiB
13Accepted2/250ms9176 KiB
14Accepted2/250ms9560 KiB
15Accepted2/248ms9920 KiB
16Accepted2/246ms10288 KiB
17Accepted2/248ms10628 KiB
18Accepted2/248ms10908 KiB
19Accepted2/246ms11048 KiB
20Accepted2/246ms11040 KiB
21Accepted2/248ms11048 KiB
22Accepted3/345ms11040 KiB
23Accepted3/346ms11036 KiB
24Accepted3/346ms11052 KiB