結果
問題 | No.892 タピオカ |
ユーザー | tak |
提出日時 | 2019-11-14 18:35:46 |
言語 | Java21 (openjdk 21) |
結果 |
AC
|
実行時間 | 59 ms / 1,000 ms |
コード長 | 3,055 bytes |
コンパイル時間 | 4,234 ms |
コンパイル使用メモリ | 82,672 KB |
実行使用メモリ | 37,444 KB |
最終ジャッジ日時 | 2024-09-21 21:27:32 |
合計ジャッジ時間 | 5,467 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 59 ms
36,932 KB |
testcase_01 | AC | 55 ms
37,444 KB |
testcase_02 | AC | 55 ms
37,312 KB |
testcase_03 | AC | 56 ms
37,048 KB |
testcase_04 | AC | 58 ms
36,844 KB |
testcase_05 | AC | 55 ms
37,352 KB |
testcase_06 | AC | 54 ms
37,180 KB |
testcase_07 | AC | 55 ms
37,188 KB |
testcase_08 | AC | 54 ms
37,412 KB |
ソースコード
import java.io.PrintWriter; import java.util.*; import java.io.*; import java.util.stream.IntStream; import java.util.stream.Stream; public class Solver { public static void main(String[] args) { new Solver().stream(); } final IO io = new IO(); final PrintWriter out = new PrintWriter(System.out); void stream() { solve(); out.flush(); } void solve() { int A_1 = io.Int(); int B_1 = io.Int(); int A_2 = io.Int(); int B_2 = io.Int(); int A_3 = io.Int(); int B_3 = io.Int(); IntStream odds = Arrays.stream(new int[]{A_1, A_2, A_3}).filter(x -> x % 2 != 0); long oddsCnt = odds.count(); System.out.println((oddsCnt % 2) == 0 ? ":-)" : ":-("); } } class IO { private final InputStream in = System.in; private final byte[] buffer = new byte[1 << 12]; private int ptr = 0, buffLen = 0; private boolean hasNextByte() { if (ptr < buffLen) return true; ptr = 0; try { buffLen = in.read(buffer); } catch (IOException e) { e.printStackTrace(); } return buffLen > 0; } private int readByte() { return hasNextByte() ? buffer[ptr++] : -1; } private boolean isPrintableChar(int c) { return 33 <= c && c <= 126; } //ASCII private void skipUnprintable() { while (hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++; } private boolean hasNext() { skipUnprintable(); return hasNextByte(); } private String next() { if (!hasNext()) throw new NoSuchElementException(); StringBuilder sb = new StringBuilder(); int b = readByte(); while (isPrintableChar(b)) { sb.appendCodePoint(b); b = readByte(); } return sb.toString(); } public String String() { return next(); } public char Char() { return next().charAt(0); } public int Int() { return Integer.parseInt(next()); } public long Long() { return Long.parseLong(next()); } public double Double() { return Double.parseDouble(next()); } public String[] StringArr(final int n) { final String[] arr = new String[n]; for (int i = 0; i < n; ++i) arr[i] = String(); return arr; } public char[] CharArr(final int n) { final char[] arr = new char[n]; for (int i = 0; i < n; ++i) arr[i] = Char(); return arr; } public int[] IntArr(final int n) { final int[] arr = new int[n]; for (int i = 0; i < n; ++i) arr[i] = Int(); return arr; } public long[] LongArr(final int n) { final long[] arr = new long[n]; for (int i = 0; i < n; ++i) arr[i] = Long(); return arr; } public double[] DoubleArr(final int n) { final double[] arr = new double[n]; for (int i = 0; i < n; ++i) arr[i] = Double(); return arr; } }