162652025-04-17 18:41:10DhaneHaneZenehallgatáscpp17Időlimit túllépés 15/50289ms1400 KiB
// zene.cpp : This file contains the 'main' function. Program execution begins and ends there.
//

#include <iostream>
#include <vector>
using namespace std;

int main()
{
    int n, k, osz = 0; cin >> n >> k;
    vector <int> zene(n + 1), time(k+1);
    for (int i = 1; i <= n; ++i) {
        cin >> zene[i];
        osz += zene[i];
    }
    int akt, j;
    for (int i = 1; i <= k; ++i) {
        cin >> time[i];
    }
    for (int i=1;i<=k;++i){
        akt= time[i] % osz;
        if (akt == 0) {
            cout << n<< " ";
        }
        else {
            j = 0;
            while (akt > 0) {
                ++j;
                akt -= zene[j];
            }
            cout << j << " ";
        }
    }
}

// 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
base15/50
1Elfogadva0/01ms316 KiB
2Időlimit túllépés0/0289ms1076 KiB
3Elfogadva2/22ms508 KiB
4Elfogadva2/22ms332 KiB
5Elfogadva2/22ms316 KiB
6Elfogadva3/32ms316 KiB
7Elfogadva3/32ms316 KiB
8Elfogadva3/32ms524 KiB
9Időlimit túllépés0/2289ms1192 KiB
10Időlimit túllépés0/2289ms1288 KiB
11Időlimit túllépés0/2289ms1076 KiB
12Időlimit túllépés0/2284ms1076 KiB
13Időlimit túllépés0/2284ms1076 KiB
14Időlimit túllépés0/2284ms1104 KiB
15Időlimit túllépés0/2284ms1400 KiB
16Időlimit túllépés0/2282ms1352 KiB
17Időlimit túllépés0/2287ms1076 KiB
18Időlimit túllépés0/2287ms1168 KiB
19Időlimit túllépés0/2287ms1192 KiB
20Időlimit túllépés0/2280ms1076 KiB
21Időlimit túllépés0/2275ms1076 KiB
22Időlimit túllépés0/3275ms1268 KiB
23Időlimit túllépés0/3275ms1076 KiB
24Időlimit túllépés0/3286ms1076 KiB