CSES - Putka Open 2015 – 1/6 - Results
Submission details
Task:Jakkara
Sender:
Submission time:2015-07-18 22:07:37 +0300
Language:Java
Status:COMPILE ERROR

Compiler report

input/Jakkara.java:12: error: unmappable character for encoding UTF8
		// Tutkitaan nelj? tapausta, valitaan pienin energia.
		                 ^
1 error

Code

import java.util.*;

public class Jakkara {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        long a = input.nextLong();
        long b = input.nextLong();
		long c = input.nextLong();
		long d = input.nextLong();
		
		
		// Tutkitaan neljä tapausta, valitaan pienin energia.
		// long pienin = Long.parseLong("10000000000");
		
		long pienin = Math.abs(b-a) + Math.abs(c-a) + Math.abs(d-a);

		long energy2 = Math.abs(a-b) + Math.abs(c-b) + Math.abs(d-b);
		if (energy2 < pienin) pienin = energy2;
		
		long energy3 = Math.abs(a-c) + Math.abs(b-c) + Math.abs(d-c);
		if (energy3 < pienin) pienin = energy3;
		
		long energy4 = Math.abs(a-d) + Math.abs(b-d) + Math.abs(c-d);
		if (energy4 < pienin) pienin = energy4;

		System.out.println(pienin);
		
    }
}