6724 | 2023. 12. 18 10:29:04 | zsebi | Zenehallgatás | cpp17 | Időlimit túllépés 21/50 | 273ms | 5860 KiB |
// zenehallgatas.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
#include <queue>
#define ll long long
using namespace std;
ll n, k;
int main()
{
cin >> n >> k;
vector<ll>x(n);
for (int i = 1; i <= n; ++i)
{
cin >>x[i-1];
if (i - 1)
x[i - 1] += x[i - 2];
}
for (int i = 1; i <= k; ++i)
{
ll a;
cin >> a;
a %= x[n - 1];
cout << lower_bound(x.begin(), x.end(), a) - x.begin()+1 << " ";
}
return 0;
}
// Run program: Ctrl + F5 or Debug > Start Without Debugging menu
// Debug program: F5 or Debug > Start Debugging menu
// Tips for Getting Started:
// 1. Use the Solution Explorer window to add/manage files
// 2. Use the Team Explorer window to connect to source control
// 3. Use the Output window to see build output and other messages
// 4. Use the Error List window to view errors
// 5. Go to Project > Add New Item to create new code files, or Project > Add Existing Item to add existing code files to the project
// 6. In the future, to open this project again, go to File > Open > Project and select the .sln file
Részfeladat | Összpont | Teszt | Verdikt | Idő | Memória | ||
---|---|---|---|---|---|---|---|
base | 21/50 | ||||||
1 | Elfogadva | 0/0 | 3ms | 1816 KiB | |||
2 | Időlimit túllépés | 0/0 | 202ms | 3404 KiB | |||
3 | Elfogadva | 2/2 | 4ms | 2272 KiB | |||
4 | Elfogadva | 2/2 | 4ms | 2312 KiB | |||
5 | Elfogadva | 2/2 | 4ms | 2448 KiB | |||
6 | Elfogadva | 3/3 | 4ms | 2648 KiB | |||
7 | Elfogadva | 3/3 | 4ms | 2856 KiB | |||
8 | Elfogadva | 3/3 | 4ms | 3100 KiB | |||
9 | Időlimit túllépés | 0/2 | 231ms | 4788 KiB | |||
10 | Időlimit túllépés | 0/2 | 259ms | 3560 KiB | |||
11 | Időlimit túllépés | 0/2 | 266ms | 3888 KiB | |||
12 | Időlimit túllépés | 0/2 | 229ms | 5288 KiB | |||
13 | Elfogadva | 2/2 | 200ms | 5496 KiB | |||
14 | Elfogadva | 2/2 | 200ms | 5340 KiB | |||
15 | Elfogadva | 2/2 | 200ms | 5340 KiB | |||
16 | Időlimit túllépés | 0/2 | 266ms | 4108 KiB | |||
17 | Időlimit túllépés | 0/2 | 263ms | 4104 KiB | |||
18 | Időlimit túllépés | 0/2 | 273ms | 4196 KiB | |||
19 | Időlimit túllépés | 0/2 | 259ms | 5516 KiB | |||
20 | Időlimit túllépés | 0/2 | 250ms | 4584 KiB | |||
21 | Időlimit túllépés | 0/2 | 226ms | 5860 KiB | |||
22 | Időlimit túllépés | 0/3 | 266ms | 4536 KiB | |||
23 | Időlimit túllépés | 0/3 | 268ms | 4472 KiB | |||
24 | Időlimit túllépés | 0/3 | 243ms | 5744 KiB |