結果
問題 | No.91 赤、緑、青の石 |
ユーザー | shinwisteria |
提出日時 | 2017-04-02 19:28:26 |
言語 | Java21 (openjdk 21) |
結果 |
WA
|
実行時間 | - |
コード長 | 678 bytes |
コンパイル時間 | 3,521 ms |
コンパイル使用メモリ | 81,976 KB |
実行使用メモリ | 71,044 KB |
最終ジャッジ日時 | 2023-09-22 07:43:42 |
合計ジャッジ時間 | 10,686 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge15 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | WA | - |
testcase_01 | TLE | - |
testcase_02 | -- | - |
testcase_03 | -- | - |
testcase_04 | -- | - |
testcase_05 | -- | - |
testcase_06 | -- | - |
testcase_07 | -- | - |
testcase_08 | -- | - |
testcase_09 | -- | - |
testcase_10 | -- | - |
testcase_11 | -- | - |
testcase_12 | -- | - |
testcase_13 | -- | - |
testcase_14 | -- | - |
testcase_15 | -- | - |
testcase_16 | -- | - |
testcase_17 | -- | - |
testcase_18 | -- | - |
testcase_19 | -- | - |
testcase_20 | -- | - |
testcase_21 | -- | - |
testcase_22 | -- | - |
testcase_23 | -- | - |
testcase_24 | -- | - |
testcase_25 | -- | - |
testcase_26 | -- | - |
testcase_27 | -- | - |
testcase_28 | -- | - |
testcase_29 | -- | - |
testcase_30 | -- | - |
testcase_31 | -- | - |
ソースコード
import java.util.Arrays; import java.util.Scanner; public class RGB { public static void main(String[] args) { // TODO 自動生成されたメソッド・スタブ Scanner s= new Scanner(System.in); int[] rgb = new int[3]; for(int i = 0;i < 3;i++){ rgb[i] = s.nextInt(); } s.close(); int count = 0; Arrays.sort(rgb); while(rgb[0] != 0 || rgb[2] >= 3){ count += rgb[0]; rgb[1] -= rgb[0]; rgb[2] -= rgb[0]; int k = (rgb[1]*3-rgb[2])/8; int i = (rgb[2]*3-rgb[1])/8; rgb[0] = k + i; rgb[1] -= 2*k; rgb[2] -= 2*i; Arrays.sort(rgb); System.out.println(rgb[0] + " " + rgb[1] + " " + rgb[2]); } System.out.println(count); } }