Rezultati

Up. imeNalogaJezikRezultatČas oddaje
algebros-2019 Malica C++ 100/100OK 09. maj '19 @ 16:30

Test Točke Porabljen spomin Porabljen čas Status
#1 [več] 16/16 1,488 MiB 0,000 s OK
#2 [več] 16/16 1,500 MiB 0,009 s OK
#3 [več] 17/17 1,461 MiB 0,000 s OK
#4 [več] 17/17 1,461 MiB 0,005 s OK
#5 [več] 17/17 1,473 MiB 0,000 s OK
#6 [več] 17/17 1,461 MiB 0,021 s OK

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

int sol[1010][4];

int main()
{
    int n, u, t, r;
    char x[200];
    char b;
    scanf("%d %d",&n,&u);

    for(int i = 0; i < n; i++)
    {
        scanf("%d %d",&t,&r);
        scanf("%[^\n]",x);
        b = getchar();

        for(int j = 0; j < t; j++)
        {
            scanf("%s",x);

            if(strcmp(x,"sirov") == 0)
                sol[r - 1][0]++;
            else if(strcmp(x,"veganski") == 0)
                sol[r - 1][1]++;
            else
                sol[r - 1][2]++;

            scanf("%[^\n]",x);
            b = getchar();
        }
    }

    for(int i = 0; i < u; i++)
        printf("%d %d %d\n",sol[i][0],sol[i][1],sol[i][2]);
}