結果

問題 No.920 あかあお
ユーザー Hoboteru4484Hoboteru4484
提出日時 2019-11-30 23:52:06
言語 Java21
(openjdk 21)
結果
AC  
実行時間 126 ms / 2,000 ms
コード長 503 bytes
コンパイル時間 4,513 ms
コンパイル使用メモリ 72,600 KB
実行使用メモリ 56,208 KB
最終ジャッジ日時 2023-08-13 09:56:20
合計ジャッジ時間 6,598 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 124 ms
55,784 KB
testcase_01 AC 123 ms
56,208 KB
testcase_02 AC 123 ms
55,528 KB
testcase_03 AC 125 ms
56,172 KB
testcase_04 AC 125 ms
55,496 KB
testcase_05 AC 123 ms
55,508 KB
testcase_06 AC 123 ms
56,156 KB
testcase_07 AC 123 ms
55,728 KB
testcase_08 AC 125 ms
55,792 KB
testcase_09 AC 124 ms
55,752 KB
testcase_10 AC 124 ms
55,756 KB
testcase_11 AC 126 ms
55,508 KB
testcase_12 AC 125 ms
55,896 KB
testcase_13 AC 124 ms
55,668 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
import java.lang.Math;

public class No920 {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    
    int redBall = sc.nextInt();
    int blueBall = sc.nextInt();
    int whiteBall = sc.nextInt();
    
    sc.close();

    while(whiteBall > 0){
      if(redBall > blueBall){
        blueBall++;
      }else if(redBall <= blueBall){
        redBall++;
      }
      whiteBall--;
    }
    System.out.println(Math.min(redBall,blueBall));
  }
}
0