結果
| 問題 | No.920 あかあお |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-11-30 23:30:42 |
| 言語 | Java (openjdk 25.0.2) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 832 bytes |
| 記録 | |
| コンパイル時間 | 2,437 ms |
| コンパイル使用メモリ | 83,244 KB |
| 実行使用メモリ | 52,944 KB |
| 最終ジャッジ日時 | 2026-05-15 09:25:57 |
| 合計ジャッジ時間 | 6,649 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 2 TLE * 1 -- * 8 |
ソースコード
import java.util.Scanner;
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();
int purpleBall = 0 ;
while(whiteBall > 0){
if((redBall + blueBall) > 0){
if(redBall < blueBall){
whiteBall--;
redBall++;
}else if (redBall > blueBall){
whiteBall--;
blueBall++;
}else {
if(whiteBall < 2){
break;
}else{
whiteBall -= 2;
blueBall++;
redBall++;
}
}
}
}
while(redBall > 0 && blueBall > 0){
redBall--;
blueBall--;
purpleBall++;
}
sc.close();
System.out.println(purpleBall);
}
}