92392024-02-19 10:55:42GervidZenehallgatáscpp17Time limit exceeded 15/50300ms13440 KiB
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>

using namespace std;

int main()
{
	int n, k, i, temp, sum = 0;
	cin >> n >> k;

	map<int, int> times;

	for (i = 0; i < n; i++)
	{
		cin >> temp;
		sum += temp;
		times[sum] = i;
	}

	for (i = 0; i < k; i++)
	{
		cin >> temp;

		cout << times.lower_bound(temp % sum).operator*().second + 1 << ' ';
	}
}
SubtaskSumTestVerdictTimeMemory
base15/50
1Accepted0/03ms2084 KiB
2Time limit exceeded0/0247ms11568 KiB
3Accepted2/24ms2640 KiB
4Accepted2/24ms2808 KiB
5Accepted2/24ms2580 KiB
6Accepted3/34ms2836 KiB
7Accepted3/34ms2924 KiB
8Accepted3/34ms3112 KiB
9Time limit exceeded0/2300ms6968 KiB
10Time limit exceeded0/2245ms12408 KiB
11Time limit exceeded0/2246ms12912 KiB
12Time limit exceeded0/2243ms12616 KiB
13Time limit exceeded0/2239ms12584 KiB
14Time limit exceeded0/2240ms12712 KiB
15Time limit exceeded0/2240ms12924 KiB
16Time limit exceeded0/2245ms12956 KiB
17Time limit exceeded0/2243ms12876 KiB
18Time limit exceeded0/2238ms13140 KiB
19Time limit exceeded0/2238ms13208 KiB
20Time limit exceeded0/2234ms13140 KiB
21Time limit exceeded0/2238ms13272 KiB
22Time limit exceeded0/3236ms13292 KiB
23Time limit exceeded0/3232ms13284 KiB
24Time limit exceeded0/3231ms13440 KiB