結果

問題 No.593 4進FizzBuzz
ユーザー noriocnorioc
提出日時 2017-11-13 00:48:55
言語 D
(dmd 2.107.1)
結果
WA  
実行時間 -
コード長 560 bytes
コンパイル時間 597 ms
コンパイル使用メモリ 92,616 KB
実行使用メモリ 7,516 KB
最終ジャッジ日時 2023-09-03 16:53:45
合計ジャッジ時間 3,734 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

import std.algorithm;
import std.array;
import std.conv;
import std.math;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

int readint() { return readln.chomp.to!int; }
int[] readints() { return readln.split.map!(to!int).array; }

void calc(string s) {
    int n = 0;
    foreach (c; s) {
        n = 4 * n + (c - '0');
    }

    if (n % 15 == 0) writeln("FizzBuzz");
    else if (n % 3 == 0) writeln("Fizz");
    else if (n % 5 == 0) writeln("Buzz");
    else writeln(s);
}

void main() {
    auto s = readln.chomp;
    calc(s);
}
0