Rezultati

Up. imeNalogaJezikRezultatČas oddaje
lml-2018 Zgoščenke C++ 100/100OK 04. okt '18 @ 18:41

Test Točke Porabljen spomin Porabljen čas Status
#1 11/11 1,488 MiB 0,000 s OK
#2 11/11 1,488 MiB 0,005 s OK
#3 11/11 1,488 MiB 0,000 s OK
#4 11/11 1,484 MiB 0,000 s OK
#5 11/11 1,488 MiB 0,005 s OK
#6 11/11 1,457 MiB 0,000 s OK
#7 11/11 1,461 MiB 0,005 s OK
#8 11/11 1,461 MiB 0,000 s OK
#9 12/12 1,461 MiB 0,005 s OK

Ocenjevani program (Zgoscenka.cpp):
#include <stdio.h>

int main()
{
    int n;
    double sums[11];
    double array[11];
    double product = 1;
    scanf("%d",&n);

    for(int i = 0; i < n; i++)
    {
        scanf("%lf",&array[i]);
        product = product * array[i];
    }

    sums[n] = 0;

    for(int i = n - 1; i >= 0; i--)
        sums[i] = sums[i + 1] + array[i];

    double product2 = 1;

    for(int i = 0; i < n; i++)
        product2 = product2 * sums[i];

    printf("%lf\n",product2/product);
}