18292022-12-04 14:40:06KovácsHunorZenehallgatáscpp11Time limit exceeded 15/50300ms4336 KiB
#include "stdio.h"
#include "stdlib.h"



int main()
{
    int n, k;
    scanf("%d%d", &n, &k);
    int* length = (int*)malloc(sizeof(int)*n);
    int* time = (int*)malloc(sizeof(int)*k);
    int sum = 0;
    for (int i = 0; i < n; i++)
    {
        scanf("%d", length + i);
        sum += length[i];
    }
    for (int i = 0; i < k; i++)
    {
        scanf("%d", time + i);
    }
    for (int i = 0; i < k; i++)
    {
        int point = time[i] % sum;
        int j = 0;
        while(length[j] < point){
            point -= length[j];
            j++;
        }
        printf("%d ", j+1);
    }
    
    
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base15/50
1Accepted0/03ms1372 KiB
2Time limit exceeded0/0300ms1964 KiB
3Accepted2/23ms1672 KiB
4Accepted2/23ms1648 KiB
5Accepted2/23ms1880 KiB
6Accepted3/33ms2012 KiB
7Accepted3/33ms2276 KiB
8Accepted3/33ms2412 KiB
9Time limit exceeded0/2300ms3188 KiB
10Time limit exceeded0/2239ms3572 KiB
11Time limit exceeded0/2280ms3768 KiB
12Time limit exceeded0/2261ms3812 KiB
13Time limit exceeded0/2261ms3732 KiB
14Time limit exceeded0/2261ms3828 KiB
15Time limit exceeded0/2256ms4040 KiB
16Time limit exceeded0/2275ms4044 KiB
17Time limit exceeded0/2268ms3924 KiB
18Time limit exceeded0/2272ms4216 KiB
19Time limit exceeded0/2264ms4164 KiB
20Time limit exceeded0/2261ms4088 KiB
21Time limit exceeded0/2261ms4016 KiB
22Time limit exceeded0/3263ms4008 KiB
23Time limit exceeded0/3259ms4204 KiB
24Time limit exceeded0/3263ms4336 KiB