結果

問題 No.593 4進FizzBuzz
ユーザー tsuchinagatsuchinaga
提出日時 2019-03-05 12:53:30
言語 Go
(1.22.1)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 318 bytes
コンパイル時間 11,961 ms
コンパイル使用メモリ 211,680 KB
実行使用メモリ 14,284 KB
最終ジャッジ日時 2023-09-05 18:51:54
合計ジャッジ時間 56,138 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 1 ms
4,376 KB
testcase_09 AC 1 ms
4,376 KB
testcase_10 AC 1 ms
4,380 KB
testcase_11 AC 2 ms
4,380 KB
testcase_12 AC 1 ms
4,376 KB
testcase_13 AC 1 ms
4,380 KB
testcase_14 AC 1 ms
4,380 KB
testcase_15 AC 1 ms
4,376 KB
testcase_16 TLE -
testcase_17 TLE -
testcase_18 TLE -
testcase_19 TLE -
testcase_20 TLE -
testcase_21 TLE -
testcase_22 TLE -
testcase_23 TLE -
testcase_24 TLE -
testcase_25 TLE -
testcase_26 TLE -
testcase_27 TLE -
testcase_28 TLE -
testcase_29 TLE -
testcase_30 TLE -
testcase_31 TLE -
testcase_32 TLE -
testcase_33 TLE -
testcase_34 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

package main

import (
	"fmt"
)

func main() {
	var n string
	_, _ = fmt.Scan(&n)

	m := 0
	for i := 0; i < len(n); i++ {
		m = (m*4 + int(n[i]-'0')) % 15
	}

	if m == 0 {
		fmt.Println("FizzBuzz")
	} else if m%3 == 0 {
		fmt.Println("Fizz")
	} else if m%5 == 0 {
		fmt.Println("Buzz")
	} else {
		fmt.Println(n)
	}
}
0