Submission #2408272


Source Code Expand

import java.util.Scanner;

class Main {
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    int a = scanner.nextInt();
    int b = scanner.nextInt();
    int c = scanner.nextInt();

    System.out.println(solve(a, b, c));
  }

  private static int solve(int a, int b, int c) {
    if (a > b) return solve(b, a, c);
    if (b > c) return solve(a, c, b);
    if ((c * 3 - (a + b + c)) % 2 == 1) return solve(a, b + 1, c + 1) + 1;

    return ((c * 3) - (a + b + c)) / 2;
  }
}

Submission Info

Submission Time
Task C - Same Integers
User hkurokawa
Language Java8 (OpenJDK 1.8.0)
Score 300
Code Size 536 Byte
Status AC
Exec Time 94 ms
Memory 22868 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 3
AC × 16
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, 10.txt, 11.txt, 12.txt, 13.txt, s1.txt, s2.txt, s3.txt
Case Name Status Exec Time Memory
01.txt AC 94 ms 19284 KB
02.txt AC 93 ms 20052 KB
03.txt AC 92 ms 18516 KB
04.txt AC 92 ms 19668 KB
05.txt AC 93 ms 22868 KB
06.txt AC 94 ms 19668 KB
07.txt AC 93 ms 18644 KB
08.txt AC 91 ms 19796 KB
09.txt AC 94 ms 18900 KB
10.txt AC 91 ms 19924 KB
11.txt AC 93 ms 19412 KB
12.txt AC 92 ms 19796 KB
13.txt AC 94 ms 18772 KB
s1.txt AC 93 ms 21844 KB
s2.txt AC 93 ms 19028 KB
s3.txt AC 93 ms 19028 KB