結果

問題 No.593 4進FizzBuzz
ユーザー uafr_csuafr_cs
提出日時 2017-11-10 22:43:46
言語 Java21
(openjdk 21)
結果
AC  
実行時間 344 ms / 2,000 ms
コード長 670 bytes
コンパイル時間 2,342 ms
コンパイル使用メモリ 73,716 KB
実行使用メモリ 63,804 KB
最終ジャッジ日時 2023-08-16 03:23:27
合計ジャッジ時間 12,782 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 111 ms
55,772 KB
testcase_01 AC 110 ms
55,600 KB
testcase_02 AC 110 ms
55,996 KB
testcase_03 AC 111 ms
55,592 KB
testcase_04 AC 109 ms
55,716 KB
testcase_05 AC 112 ms
55,612 KB
testcase_06 AC 111 ms
55,524 KB
testcase_07 AC 111 ms
55,856 KB
testcase_08 AC 111 ms
55,836 KB
testcase_09 AC 111 ms
55,672 KB
testcase_10 AC 111 ms
55,424 KB
testcase_11 AC 110 ms
55,992 KB
testcase_12 AC 113 ms
55,880 KB
testcase_13 AC 114 ms
55,652 KB
testcase_14 AC 110 ms
55,836 KB
testcase_15 AC 117 ms
55,712 KB
testcase_16 AC 320 ms
62,920 KB
testcase_17 AC 319 ms
63,232 KB
testcase_18 AC 319 ms
63,340 KB
testcase_19 AC 339 ms
63,148 KB
testcase_20 AC 320 ms
63,432 KB
testcase_21 AC 316 ms
63,804 KB
testcase_22 AC 341 ms
63,736 KB
testcase_23 AC 313 ms
63,348 KB
testcase_24 AC 318 ms
63,304 KB
testcase_25 AC 318 ms
63,344 KB
testcase_26 AC 343 ms
63,096 KB
testcase_27 AC 336 ms
63,448 KB
testcase_28 AC 319 ms
63,164 KB
testcase_29 AC 341 ms
63,332 KB
testcase_30 AC 316 ms
63,748 KB
testcase_31 AC 324 ms
63,444 KB
testcase_32 AC 324 ms
63,192 KB
testcase_33 AC 344 ms
63,704 KB
testcase_34 AC 319 ms
62,960 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.math.BigInteger;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.Scanner;

public class Main {
	
	public static long MOD = 1000000007;
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		final String str = sc.next();
		
		long mod = 0;
		for(int i = 0; i < str.length(); i++){
			mod *= 4;
			mod %= 15;
			
			mod += Character.getNumericValue(str.charAt(i));
			mod %= 15;
		}
		
		if(mod % 15 == 0){
			System.out.println("FizzBuzz");
		}else if(mod % 5 == 0){
			System.out.println("Buzz");
		}else if(mod % 3 == 0){
			System.out.println("Fizz");
		}else{
			System.out.println(str);
		}
		
	}
}
0