Submission #4035492


Source Code Expand

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.lang.reflect.Array;
import java.util.Arrays;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */

public class Main {
    public static void main(String[] args) {
        InputStream    inputStream    = System.in;
        OutputStream outputStream = System.out;
        InputReader    in                      = new InputReader(inputStream);
        PrintWriter      out                    = new PrintWriter(outputStream);
        Task                 solver               = new Task();
        solver.solve(1, in, out);
        out.close();
    }

    static class Task {
    	public void solve(int testNumber, InputReader in, PrintWriter out) {
    		int A = in.nextInt();
    		int B = in.nextInt();
    		int C = in.nextInt();
    		int D = in.nextInt();
    		if(A + B > C + D) {
    			out.println("Left");
    		}else if(A + B < C +D) {
    			out.println("Right");
    		}else {
    			out.println("Balanced");
    		}
    	}
    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}

Submission Info

Submission Time
Task A - Libra
User tmp_jp
Language Java8 (OpenJDK 1.8.0)
Score 100
Code Size 2062 Byte
Status AC
Exec Time 75 ms
Memory 22996 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 100 / 100
Status
AC × 3
AC × 12
Set Name Test Cases
Sample s1.txt, s2.txt, s3.txt
All 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, s1.txt, s2.txt, s3.txt
Case Name Status Exec Time Memory
01.txt AC 75 ms 20692 KB
02.txt AC 74 ms 19412 KB
03.txt AC 74 ms 18004 KB
04.txt AC 73 ms 22996 KB
05.txt AC 75 ms 20308 KB
06.txt AC 75 ms 17108 KB
07.txt AC 74 ms 21460 KB
08.txt AC 75 ms 19540 KB
09.txt AC 73 ms 20308 KB
s1.txt AC 75 ms 18900 KB
s2.txt AC 75 ms 20948 KB
s3.txt AC 75 ms 20436 KB