結果
| 問題 | No.920 あかあお |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-11-30 23:40:34 |
| 言語 | Java (openjdk 25.0.2) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 1,150 bytes |
| 記録 | |
| コンパイル時間 | 2,827 ms |
| コンパイル使用メモリ | 82,288 KB |
| 実行使用メモリ | 64,480 KB |
| 最終ジャッジ日時 | 2026-05-15 09:26:51 |
| 合計ジャッジ時間 | 9,383 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | TLE * 1 -- * 2 |
| other | -- * 11 |
ソースコード
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 ;
if((redBall + blueBall) == 0){
purpleBall = whiteBall / 2;
}else{
while(redBall > 0 && blueBall > 0){
redBall--;
blueBall--;
purpleBall++;
}
while(whiteBall > 0){
if((redBall + blueBall) > 0){
if(redBall < blueBall){
whiteBall--;
blueBall--;
purpleBall++;
}else if (redBall > blueBall){
whiteBall--;
redBall--;
purpleBall++;
}else {
if(whiteBall < 2){
break;
}else{
whiteBall -= 2;
purpleBall++;
}
}
}
}
}
sc.close();
System.out.println(purpleBall);
}
}