192132025-11-30 13:13:53szabelrZenehallgatáspypy3Futási hiba 0/5079ms22792 KiB
// zenehalllgatas.cpp : This file contains the 'main' function. Program execution begins and ends there.
//

#include <iostream>
#include <vector>
using namespace std;
using ll = long long;

int main()
{
    ll n, k,x;
    cin >> n >> k;
    vector<ll>zenek(n+2);
    zenek[0] = 0;
    for (ll i = 1; i <= n; i++)
    {
        cin >> x;
        zenek[i] = zenek[i - 1] + x;
    }
    for (ll i = 1; i <= k; i++) {
        cin >> x;
        if (x > zenek[n] ) {
            x = x % zenek[n];
        }

        for (ll y = 1; y <= n; y++) {
            if (x == zenek[y])
                cout << y<<" ";
            else if (x > zenek[y - 1] and x < zenek[y])
                cout << y << " ";
        }
    }

}

// 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ÖsszpontTesztVerdiktIdőMemória
base0/50
1Futási hiba0/071ms22700 KiB
2Futási hiba0/072ms22736 KiB
3Futási hiba0/264ms22748 KiB
4Futási hiba0/265ms22756 KiB
5Futási hiba0/265ms22744 KiB
6Futási hiba0/372ms22764 KiB
7Futási hiba0/364ms22760 KiB
8Futási hiba0/372ms22700 KiB
9Futási hiba0/279ms22760 KiB
10Futási hiba0/271ms22760 KiB
11Futási hiba0/264ms22792 KiB
12Futási hiba0/264ms22604 KiB
13Futási hiba0/265ms22760 KiB
14Futási hiba0/274ms22760 KiB
15Futási hiba0/272ms22756 KiB
16Futási hiba0/264ms22576 KiB
17Futási hiba0/272ms22604 KiB
18Futási hiba0/265ms22676 KiB
19Futási hiba0/272ms22788 KiB
20Futási hiba0/264ms22584 KiB
21Futási hiba0/272ms22760 KiB
22Futási hiba0/365ms22788 KiB
23Futási hiba0/364ms22580 KiB
24Futási hiba0/371ms22756 KiB