157952025-02-27 17:56:58ErdélyiRómeóZenehallgatáscpp17Time limit exceeded 15/50300ms1600 KiB
#include <iostream>
#include <bits/stdc++.h>

using namespace std;


/*
3 2
2 4 3
6 10
*/
int main()
{
    int n,k;
    cin>>n>>k;
    int a[n];
    int b[k];
    int c[n];
    int osszeg=0;

    for(int i=0; i<n; i++)
    {
        cin>>a[i];
        osszeg+=a[i];
        c[i]=osszeg;
    }
    for(int i=0; i<k; i++)
    {
        cin>>b[i];
    }


    int kivonat;

    for(int i=0; i<k; i++)
    {
        kivonat=b[i]%osszeg;

        for(int i=0; i<n; i++)
        {

            if(kivonat<=c[i])
            {
                cout<<i+1<<" ";
                break;
            }


        }


    }


    return 0;
}
SubtaskSumTestVerdictTimeMemory
base15/50
1Accepted0/01ms500 KiB
2Time limit exceeded0/0279ms1388 KiB
3Accepted2/22ms316 KiB
4Accepted2/22ms316 KiB
5Accepted2/22ms408 KiB
6Accepted3/32ms316 KiB
7Accepted3/32ms508 KiB
8Accepted3/32ms316 KiB
9Time limit exceeded0/2300ms1584 KiB
10Time limit exceeded0/2300ms1588 KiB
11Time limit exceeded0/2300ms1508 KiB
12Time limit exceeded0/2282ms1588 KiB
13Time limit exceeded0/2289ms1588 KiB
14Time limit exceeded0/2291ms1476 KiB
15Time limit exceeded0/2300ms1588 KiB
16Time limit exceeded0/2282ms1588 KiB
17Time limit exceeded0/2280ms1588 KiB
18Time limit exceeded0/2284ms1588 KiB
19Time limit exceeded0/2300ms1588 KiB
20Time limit exceeded0/2284ms1588 KiB
21Time limit exceeded0/2287ms1592 KiB
22Time limit exceeded0/3291ms1600 KiB
23Time limit exceeded0/3300ms1484 KiB
24Time limit exceeded0/3291ms1588 KiB