結果

問題 No.920 あかあお
ユーザー Hoboteru4484
提出日時 2019-11-30 23:52:06
言語 Java
(openjdk 23)
結果
AC  
実行時間 136 ms / 2,000 ms
コード長 503 bytes
コンパイル時間 3,448 ms
コンパイル使用メモリ 74,600 KB
実行使用メモリ 54,228 KB
最終ジャッジ日時 2024-11-21 03:44:46
合計ジャッジ時間 5,862 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 11
権限があれば一括ダウンロードができます

ソースコード

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