Rezultati

Up. imeNalogaJezikRezultatČas oddaje
lml-2018 Podnapisi Java 0/100Napaka med izvajanjem / ob izhodu (RTE) 10. maj '18 @ 17:08

Test Točke Porabljen spomin Porabljen čas Status
#1 0/7 42,188 MiB 0,000 s Program je končal z neničelno kodo
Stderr:
Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 5
	at java.lang.String.substring(String.java:1963)
	at Program1.main(Program1.java:21)
#2 0/7 39,227 MiB 0,000 s Program je končal z neničelno kodo
Stderr:
Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 2
	at java.lang.String.substring(String.java:1963)
	at Program1.main(Program1.java:20)
#3 0/7 36,547 MiB 0,000 s Program je končal z neničelno kodo
Stderr:
Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 2
	at java.lang.String.substring(String.java:1963)
	at Program1.main(Program1.java:20)
#4 0/7 36,793 MiB 0,000 s Program je končal z neničelno kodo
Stderr:
Exception in thread "main" java.lang.NumberFormatException: For input string: "In"
	at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
	at java.lang.Integer.parseInt(Integer.java:580)
	at java.lang.Integer.parseInt(Integer.java:615)
	at Program1.main(Program1.java:20)
#5 0/7 38,512 MiB 0,000 s Program je končal z neničelno kodo
Stderr:
Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 2
	at java.lang.String.substring(String.java:1963)
	at Program1.main(Program1.java:20)
#6 0/7 38,617 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,258 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 37,508 MiB 0,000 s Program je končal z neničelno kodo
Stderr:
Exception in thread "main" java.lang.NumberFormatException: For input string: "SH"
	at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
	at java.lang.Integer.parseInt(Integer.java:580)
	at java.lang.Integer.parseInt(Integer.java:615)
	at Program1.main(Program1.java:20)
#9 0/7 39,645 MiB 0,000 s Program je končal z neničelno kodo
Stderr:
Exception in thread "main" java.lang.NumberFormatException: For input string: "//"
	at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
	at java.lang.Integer.parseInt(Integer.java:569)
	at java.lang.Integer.parseInt(Integer.java:615)
	at Program1.main(Program1.java:20)
#10 0/7 41,539 MiB 0,000 s Program je končal z neničelno kodo
Stderr:
Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 2
	at java.lang.String.substring(String.java:1963)
	at Program1.main(Program1.java:20)
#11 0/7 34,563 MiB 0,000 s Program je končal z neničelno kodo
Stderr:
Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 2
	at java.lang.String.substring(String.java:1963)
	at Program1.main(Program1.java:20)
#12 0/7 37,508 MiB 0,000 s Program je končal z neničelno kodo
Stderr:
Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 2
	at java.lang.String.substring(String.java:1963)
	at Program1.main(Program1.java:20)
#13 0/8 37,730 MiB 0,000 s Program je končal z neničelno kodo
Stderr:
Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 2
	at java.lang.String.substring(String.java:1963)
	at Program1.main(Program1.java:20)
#14 0/8 39,215 MiB 0,000 s Program je končal z neničelno kodo
Stderr:
Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 2
	at java.lang.String.substring(String.java:1963)
	at Program1.main(Program1.java:20)

Ocenjevani program (Program1.java):
import java.util.*;
import java.lang.*;

public class Program1
{
    public static void main(String[]args)
    {
        Scanner skan = new Scanner(System.in);
        String shift = skan.nextLine();
        int h = Integer.parseInt(shift.substring(7,9));
        int min = Integer.parseInt(shift.substring(10,12));
        int sec = Integer.parseInt(shift.substring(13,15));
        int msec = Integer.parseInt(shift.substring(16,19));
        
        while(skan.hasNext())
        {
            String num = skan.nextLine();
            String time = skan.nextLine();
            String text = skan.nextLine();
            int h1 = Integer.parseInt(time.substring(0,2));
            int min1 = Integer.parseInt(time.substring(3,5));
            int sec1 = Integer.parseInt(time.substring(6,8));
            int msec1 = Integer.parseInt(time.substring(9,12));
            int h2 = Integer.parseInt(time.substring(17,19));
            int min2 = Integer.parseInt(time.substring(20,22));
            int sec2 = Integer.parseInt(time.substring(23,25));
            int msec2 = Integer.parseInt(time.substring(26,29));
           // System.out.println(h1 + " " + min1 + " " + sec1 + " " + msec1 + " " + h2 + " " + min2 + " " + sec2 + " " + msec2);
            msec1 += msec;
            msec2 += msec;

            if(msec1 >= 1000)
            {
                msec1 -= 1000;
                sec1++;
            }

            if(msec2 >= 1000)
            {
                msec2 -= 1000;
                sec2++;
            }

            sec1 += sec;
            sec2 += sec;

            if(sec1 >= 60)
            {
                sec1 -= 60;
                min1++;
            }

            if(sec2 >= 60)
            {
                sec2 -= 60;
                min2++;
            }

            min1 += min;
            min2 += min;

            if(min1 >= 60)
            {
                min1 -= 60;
                h1++;
            }

            if(min2 >= 60)
            {
                min2 -= 60;
                h2++;
            }

            h1 += h;
            h2 += h;

            System.out.println(num);

            if(h1 < 10)
            {
                System.out.print("0" + h1 + ":");
            }
            else
            {
                System.out.println(h1 + ":");
            }

            if(min1 < 10)
            {
                System.out.print("0" + min1 + ":");
            }
            else
            {
                System.out.print(min1 + ":");
            }

            if(sec1 < 10)
            {
                System.out.print("0" + sec1 + ":");
            }
            else
            {
                System.out.print(sec1 + ":");
            }

            if(msec1 < 10)
            {
                System.out.print("00" + msec1 + " --> ");
            }
            else if(msec1 < 100)
            {
                System.out.print("0" + msec1 + " --> ");
            }
            else
            {
                System.out.print(msec1 + " --> ");
            }

            if(h2 < 10)
            {
                System.out.print("0" + h2 + ":");
            }
            else
            {
                System.out.println(h2 + ":");
            }

            if(min2 < 10)
            {
                System.out.print("0" + min2 + ":");
            }
            else
            {
                System.out.print(min2 + ":");
            }

            if(sec2 < 10)
            {
                System.out.print("0" + sec2 + ":");
            }
            else
            {
                System.out.print(sec2 + ":");
            }

            if(msec2 < 10)
            {
                System.out.println("00" + msec2);
            }
            else if(msec1 < 100)
            {
                System.out.println("0" + msec2);
            }
            else
            {
                System.out.println(msec2);
            }

            System.out.println(text);

            if(skan.hasNext())
            { 
                String empty = skan.nextLine();
            }
        }
    }
}