結果

問題 No.593 4進FizzBuzz
ユーザー maimai
提出日時 2017-08-03 07:31:24
言語 Java21
(openjdk 21)
結果
TLE  
実行時間 -
コード長 791 bytes
コンパイル時間 3,241 ms
コンパイル使用メモリ 83,280 KB
実行使用メモリ 61,124 KB
最終ジャッジ日時 2024-04-22 14:39:49
合計ジャッジ時間 9,471 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 113 ms
46,536 KB
testcase_01 AC 110 ms
40,912 KB
testcase_02 AC 114 ms
41,240 KB
testcase_03 AC 109 ms
39,960 KB
testcase_04 AC 112 ms
40,940 KB
testcase_05 AC 113 ms
41,052 KB
testcase_06 AC 108 ms
41,356 KB
testcase_07 AC 98 ms
39,832 KB
testcase_08 AC 110 ms
41,184 KB
testcase_09 AC 107 ms
41,076 KB
testcase_10 AC 110 ms
41,108 KB
testcase_11 AC 112 ms
41,208 KB
testcase_12 AC 106 ms
40,908 KB
testcase_13 AC 109 ms
40,944 KB
testcase_14 AC 97 ms
39,868 KB
testcase_15 AC 110 ms
40,956 KB
testcase_16 TLE -
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 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.lang.*;
import java.math.*;

public class prog {

    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String line = sc.nextLine();
        
        BigInteger num = new BigInteger(line,4);
        
        BigInteger rem5 = num.remainder(new BigInteger("5"));
        BigInteger rem3 = num.remainder(new BigInteger("3"));
        
        boolean div5 = BigInteger.ZERO.equals(rem5);
        boolean div3 = BigInteger.ZERO.equals(rem3);
        
        if (div5 && div3){
            System.out.println("FizzBuzz");
        }else if (div5){
            System.out.println("Buzz");
        }else if (div3){
            System.out.println("Fizz");
        }else{
            System.out.println(line);
        }
	}
}
0