結果
問題 | No.1934 Four Fruits |
ユーザー | sysnote8main |
提出日時 | 2023-02-22 20:09:51 |
言語 | Java21 (openjdk 21) |
結果 |
WA
|
実行時間 | - |
コード長 | 857 bytes |
コンパイル時間 | 4,713 ms |
コンパイル使用メモリ | 71,768 KB |
実行使用メモリ | 56,296 KB |
最終ジャッジ日時 | 2023-09-30 03:02:05 |
合計ジャッジ時間 | 6,765 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge12 |
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 123 ms
56,008 KB |
testcase_01 | AC | 123 ms
55,888 KB |
testcase_02 | AC | 125 ms
56,296 KB |
testcase_03 | AC | 124 ms
55,432 KB |
testcase_04 | WA | - |
testcase_05 | AC | 124 ms
55,712 KB |
testcase_06 | AC | 123 ms
55,668 KB |
testcase_07 | AC | 123 ms
55,744 KB |
testcase_08 | AC | 124 ms
56,144 KB |
testcase_09 | AC | 126 ms
56,036 KB |
ソースコード
import java.util.Scanner; public class four_fruits { public static void main(String[] args) { boolean[] bools = { false, false, false, false }; Scanner sc = new Scanner(System.in); int a = sc.nextInt(); int b = sc.nextInt(); int c = sc.nextInt(); sc.close(); bools[a] = true; bools[b] = true; bools[c] = true; int cnt = 0; for (boolean i : bools) { if (i) { cnt++; } } int out = 0; switch (cnt) { case 1: out = a; break; case 2: if (a == b) { out = c; } else if (b == c) { out = a; } else { out = b; } break; case 3: for (int i = 0; i < 3; i++) { if (bools[i] == false) { out = i; } } } System.out.println(out); } }