Rezultati

Up. imeNalogaJezikRezultatČas oddaje
KTK Podnapisi Java 0/100Prekoračen čas (TLE) 10. maj '18 @ 17:08

Test Točke Porabljen spomin Porabljen čas Status
#1 0/7 52,773 MiB 0,037 s Napačen odgovor
Tvoj izhod:
​1
01:10:30:285 --> 01:10:33:049
?RNO OGLEDALO

2
01:11:11:245 --> 01:11:12:849
Pravilen izhod:
​1
01:10:30,285 --> 01:10:33,049
?RNO OGLEDALO

2
01:11:11,245 --> 01:11:12,849
#2 0/7 64,895 MiB 0,411 s Napačen odgovor
Tvoj izhod:
​1
20:59:26:343 --> 20:59:27:945
All right, everybody.

2
20:59:27:978 --> 20:59:29:512
Pravilen izhod:
​1
20:59:26,343 --> 20:59:27,945
All right, everybody.

2
20:59:27,978 --> 20:59:29,512
#3 0/7 36,789 MiB 0,000 s Napačen odgovor
Tvoj izhod:
​1
00:00:04:880 --> 00:00:06:630
In 2022, mankind finally

2
00:00:09:600 --> 00:00:11:590
Pravilen izhod:
​1
00:00:04,880 --> 00:00:06,630
In 2022, mankind finally

2
00:00:09,600 --> 00:00:11,590
#4 0/7 76,801 MiB 0,307 s Napačen odgovor
Tvoj izhod:
​1
01:24:16:872 --> 01:24:18:622
In 2022, mankind finally
In 2022, mankind finally
In 2022, mankind finally
In 2022, mankind finally
Pravilen izhod:
​1
01:24:16,872 --> 01:24:18,622
In 2022, mankind finally
In 2022, mankind finally
In 2022, mankind finally
In 2022, mankind finally
#5 0/7 39,523 MiB 0,000 s Napačen odgovor
Tvoj izhod:
​1
23:59:28:759 --> 23:59:30:509
In 2022, mankind finally

2
23:59:33:479 --> 23:59:35:469
Pravilen izhod:
​1
23:59:28,759 --> 23:59:30,509
In 2022, mankind finally

2
23:59:33,479 --> 23:59:35,469
#6 0/7 37,113 MiB 0,000 s Napačen odgovor
Tvoj izhod:
​1
00:01:27:881 --> 00:01:29:631
00:00:04,880 --> 00:00:06,630
<<<EOF>>>
Pravilen izhod:
​1
00:01:27,881 --> 00:01:29,631
00:00:04,880 --> 00:00:06,630
<<<EOF>>>
#7 0/7 37,074 MiB 0,000 s Napačen odgovor
Tvoj izhod:
​1
00:11:15:100 --> 00:11:16:850
0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!"$%&\'()*+,-./:;<=>?@[\]^_{|}~ `20123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!"$%&\'()*+,-./:;<=>?@[\]^_{|}~ `2
<<<EOF>>>
Pravilen izhod:
​1
00:11:15,100 --> 00:11:16,850
0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!"$%&\'()*+,-./:;<=>?@[\]^_{|}~ `20123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!"$%&\'()*+,-./:;<=>?@[\]^_{|}~ `2
<<<EOF>>>
#8 0/7 35,895 MiB 0,000 s Napačen odgovor
Tvoj izhod:
​1
00:11:15:100 --> 00:11:16:850
2
SHIFT: 00:11:10,220
00:00:04,880 --> 00:00:06,630
00:00:04,880 --> 00:00:06,630
Pravilen izhod:
​1
00:11:15,100 --> 00:11:16,850
2
SHIFT: 00:11:10,220
00:00:04,880 --> 00:00:06,630
00:00:04,880 --> 00:00:06,630
#9 0/7 35,770 MiB 0,000 s Napačen odgovor
Tvoj izhod:
​1
13:59:28:759 --> 13:59:30:509
SHIFT: 13:59:23,879
In 2022, mankind finally
? comment?
// nooo
Pravilen izhod:
​1
13:59:28,759 --> 13:59:30,509
SHIFT: 13:59:23,879
In 2022, mankind finally
? comment?
// nooo
#10 0/7 84,727 MiB 1,280 s Prekoračen čas
#11 0/7 37,266 MiB 0,000 s Napačen odgovor
Tvoj izhod:
​1
00:00:06:180 --> 00:00:07:930
In 2022, mankind finally

2
00:00:10:900 --> 00:00:12:890
Pravilen izhod:
​1
00:00:06,180 --> 00:00:07,930
In 2022, mankind finally

2
00:00:10,900 --> 00:00:12,890
#12 0/7 58,461 MiB 0,044 s Napačen odgovor
Tvoj izhod:
​1
00:10:00:681 --> 00:10:02:081
<i>Previously on</i>
The Big Bang Theory...

2
Pravilen izhod:
​1
00:10:00,681 --> 00:10:02,081
<i>Previously on</i>
The Big Bang Theory...

2
#13 0/8 60,887 MiB 0,262 s Napačen odgovor
Tvoj izhod:
​1
03:13:13:073 --> 03:13:17:073
PUENTE ANTIGUO,
NOVA MEHIKA

2
Pravilen izhod:
​1
03:13:13,073 --> 03:13:17,073
PUENTE ANTIGUO,
NOVA MEHIKA

2
#14 0/8 40,383 MiB 0,000 s Napačen odgovor
Tvoj izhod:
​1
01:10:25:000 --> 01:10:30:130
In 2022, mankind finally

2
01:11:01:000 --> 01:11:05:090
Pravilen izhod:
​1
01:10:25,000 --> 01:10:30,130
In 2022, mankind finally

2
01:11:01,000 --> 01:11:05,090

Ocenjevani program (Naloga1.java):
import java.util.Scanner;

public class Naloga1 {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        //podnapisi
        int[] zamik=pretvoriCas(scanner.nextLine().substring(7));
        int stanje=0;
        //0-st podnapisa
        //1-cas
        //2-vsebina
        int zaporednaSt=1;
        while(scanner.hasNextLine()){
            String vrstica=scanner.nextLine();
            if(stanje==0){
                if(preveriZapSt(vrstica,zaporednaSt)){
                    System.out.println(vrstica);
                    stanje=1;
                    zaporednaSt++;
                }else {
                    stanje=2;
                    System.out.println(vrstica);
                }
            }else if(stanje==1){
                //obdelava casov
                String[] obaCasa=vrstica.split(" --> ");
                int[] prviCas=pretvoriCas(obaCasa[0]);
                int[] drugiCas=pretvoriCas(obaCasa[1]);
                pristejCas(prviCas,zamik);
                pristejCas(drugiCas,zamik);
                System.out.print(vString(prviCas[0],2)+":"+vString(prviCas[1],2)+":"+vString(prviCas[2],2)+":"+vString(prviCas[3],3));
                System.out.print(" --> ");
                System.out.println(vString(drugiCas[0],2)+":"+vString(drugiCas[1],2)+":"+vString(drugiCas[2],2)+":"+vString(drugiCas[3],3));
                stanje=2;
            }else if(stanje==2){
                if(vrstica.length()==0)
                    stanje=0;
                System.out.println(vrstica);
            }
        }
    }
    static boolean preveriZapSt(String text, int st){
        int t;
        try {
            t=Integer.parseInt(text);
            return t==st;
        }catch (Exception e){
            return false;
        }
    }
    static void pristejCas(int[] cas, int[] zamik){
        cas[3]+=zamik[3];
        while (cas[3]>=1000){
            cas[3]-=1000;
            cas[2]+=1;
        }
        cas[2]+=zamik[2];
        while(cas[2]>=60){
            cas[2]-=60;
            cas[1]+=1;
        }
        cas[1]+=zamik[1];
        while(cas[1]>=60){
            cas[1]-=60;
            cas[0]+=1;
        }
        cas[0]+=zamik[0];
    }
    static String vString(int i, int dolzina){
        StringBuilder odg=new StringBuilder();
        odg.append(i);
        while (odg.length()<dolzina)
            odg.insert(0,"0");
        return odg.toString();
    }
    static int[] pretvoriCas(String casVhod){
        String cas=casVhod.split(",")[0];
        int milisek=Integer.parseInt(casVhod.split(",")[1]);
        int[] odg=new int[4];
        String[] casi=cas.split(":");
        odg[0]=Integer.parseInt(casi[0]);
        odg[1]=Integer.parseInt(casi[1]);
        odg[2]=Integer.parseInt(casi[2]);
        odg[3]=milisek;
        return odg;
    }
}