18272022-12-04 14:25:30KovácsHunorZenehallgatáscpp11Time limit exceeded 15/50300ms4124 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)*n);
    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/03ms1300 KiB
2Time limit exceeded0/0300ms1892 KiB
3Accepted2/23ms1776 KiB
4Accepted2/23ms1656 KiB
5Accepted2/23ms1884 KiB
6Accepted3/33ms2088 KiB
7Accepted3/33ms2164 KiB
8Accepted3/33ms2316 KiB
9Time limit exceeded0/2300ms2724 KiB
10Time limit exceeded0/2259ms2844 KiB
11Time limit exceeded0/2280ms3004 KiB
12Time limit exceeded0/2236ms3320 KiB
13Time limit exceeded0/2259ms3280 KiB
14Time limit exceeded0/2239ms3416 KiB
15Time limit exceeded0/2256ms3520 KiB
16Time limit exceeded0/2245ms3596 KiB
17Time limit exceeded0/2237ms3696 KiB
18Time limit exceeded0/2273ms3524 KiB
19Time limit exceeded0/2277ms3588 KiB
20Time limit exceeded0/2264ms3688 KiB
21Time limit exceeded0/2277ms3784 KiB
22Time limit exceeded0/3264ms3864 KiB
23Time limit exceeded0/3256ms3956 KiB
24Time limit exceeded0/3284ms4124 KiB