Rezultati

Up. imeNalogaJezikRezultatČas oddaje
finalsolution-2018 Podnapisi C 100/100OK 10. maj '18 @ 16:26

Test Točke Porabljen spomin Porabljen čas Status
#1 7/7 1,488 MiB 0,004 s OK
#2 7/7 1,488 MiB 0,004 s OK
#3 7/7 1,461 MiB 0,000 s OK
#4 7/7 1,461 MiB 0,002 s OK
#5 7/7 1,465 MiB 0,000 s OK
#6 7/7 1,461 MiB 0,000 s OK
#7 7/7 1,484 MiB 0,000 s OK
#8 7/7 1,488 MiB 0,000 s OK
#9 7/7 1,461 MiB 0,000 s OK
#10 7/7 1,488 MiB 0,009 s OK
#11 7/7 1,488 MiB 0,000 s OK
#12 7/7 1,488 MiB 0,004 s OK
#13 8/8 1,453 MiB 0,004 s OK
#14 8/8 1,461 MiB 0,000 s OK

Ocenjevani program (podnapisi.c):
#include <stdio.h>

static char S[256];

static int scantime(void) {
    int h = 0, m = 0, s = 0, ms = 0;
    scanf("%d:%d:%d,%d ", &h, &m, &s, &ms);
    return 3600000 * h + 60000 * m + 1000 * s + ms;
}

static void printtime(int t) {
    printf("%02d:%02d:%02d,%03d", t / 3600000, (t / 60000) % 60, (t / 1000) % 60, t % 1000);
}

int main() {
    scanf("SHIFT:");
    int shift = scantime();
    int i = 0;
    while (scanf("%d", &i) == 1) {
        int st = scantime() + shift;
        scanf(" -->");
        int et = scantime() + shift;
        printf("%d\n", i);
        printtime(st);
        printf(" --> ");
        printtime(et);
        printf("\n");
        while (gets(S)) {
            printf("%s\n", S);
            if (!S[0]) break;
        }
    }
    return 0;
}