結果

問題 No.9002 FizzBuzz(テスト用)
ユーザー vjudge1
提出日時 2025-06-14 11:26:40
言語 Crystal
(1.14.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 634 bytes
コンパイル時間 14,362 ms
コンパイル使用メモリ 307,236 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2025-06-14 11:26:56
合計ジャッジ時間 13,383 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 4
権限があれば一括ダウンロードができます

ソースコード

diff #

lib C
    fun getchar_unlocked : Int32
    fun isspace(c : Int32) : Bool
end
fun read_int : Int32
    ans = 0
    f = 1
    c = C.getchar_unlocked()
    while C.isspace(c)
        c = C.getchar_unlocked()
    end
    if c == 45
        f = -1i64
        c = C.getchar_unlocked()
    end
    while (48 .. 57).includes?(c)
        ans = (ans << 1) + (ans << 3) + (c ^ 48)
        c = C.getchar_unlocked()
    end
    return ans * f
end
puts Array(String).new(read_int) { |i|
    if i % 15 == 14
        "FizzBuzz"
    elsif i % 5 == 4
        "Buzz"
    elsif i % 3 == 2
        "Fizz"
    else
        (i + 1).to_s
    end
}.join("\n")
0