結果
問題 | No.593 4進FizzBuzz |
ユーザー | tenten |
提出日時 | 2023-07-27 17:41:11 |
言語 | Java21 (openjdk 21) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,888 bytes |
コンパイル時間 | 2,438 ms |
コンパイル使用メモリ | 90,260 KB |
実行使用メモリ | 62,944 KB |
最終ジャッジ日時 | 2024-04-15 04:46:32 |
合計ジャッジ時間 | 9,472 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 53 ms
50,248 KB |
testcase_01 | AC | 52 ms
50,468 KB |
testcase_02 | AC | 51 ms
50,492 KB |
testcase_03 | AC | 52 ms
50,464 KB |
testcase_04 | AC | 51 ms
50,240 KB |
testcase_05 | AC | 51 ms
50,224 KB |
testcase_06 | AC | 53 ms
50,236 KB |
testcase_07 | AC | 51 ms
50,396 KB |
testcase_08 | AC | 53 ms
50,020 KB |
testcase_09 | AC | 51 ms
50,388 KB |
testcase_10 | AC | 51 ms
50,504 KB |
testcase_11 | AC | 52 ms
49,936 KB |
testcase_12 | AC | 53 ms
50,380 KB |
testcase_13 | AC | 52 ms
50,404 KB |
testcase_14 | AC | 51 ms
50,312 KB |
testcase_15 | AC | 52 ms
50,180 KB |
testcase_16 | WA | - |
testcase_17 | WA | - |
testcase_18 | AC | 191 ms
62,568 KB |
testcase_19 | WA | - |
testcase_20 | WA | - |
testcase_21 | AC | 197 ms
62,496 KB |
testcase_22 | AC | 227 ms
62,704 KB |
testcase_23 | WA | - |
testcase_24 | WA | - |
testcase_25 | AC | 195 ms
62,588 KB |
testcase_26 | AC | 232 ms
62,688 KB |
testcase_27 | WA | - |
testcase_28 | WA | - |
testcase_29 | AC | 231 ms
62,600 KB |
testcase_30 | WA | - |
testcase_31 | WA | - |
testcase_32 | AC | 193 ms
62,324 KB |
testcase_33 | AC | 234 ms
62,360 KB |
testcase_34 | WA | - |
ソースコード
import java.io.*; import java.util.*; import java.util.stream.*; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(); char[] inputs = sc.next().toCharArray(); int value = 0; for (char c : inputs) { value *= 4; value += c - '0'; } String ans; if (value % 15 == 0) { ans = "FizzBuzz"; } else if (value % 3 == 0) { ans = "Fizz"; } else if (value % 5 == 0) { ans = "Buzz"; } else { ans = new String(inputs); } System.out.println(ans); } } class Utilities { static String arrayToLineString(Object[] arr) { return Arrays.stream(arr).map(x -> x.toString()).collect(Collectors.joining("\n")); } static String arrayToLineString(int[] arr) { return String.join("\n", Arrays.stream(arr).mapToObj(String::valueOf).toArray(String[]::new)); } } class Scanner { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(""); StringBuilder sb = new StringBuilder(); public Scanner() throws Exception { } public int nextInt() throws Exception { return Integer.parseInt(next()); } public long nextLong() throws Exception { return Long.parseLong(next()); } public double nextDouble() throws Exception { return Double.parseDouble(next()); } public int[] nextIntArray() throws Exception { return Stream.of(br.readLine().split(" ")).mapToInt(Integer::parseInt).toArray(); } public String next() throws Exception { while (!st.hasMoreTokens()) { st = new StringTokenizer(br.readLine()); } return st.nextToken(); } }