結果

問題 No.9001 標準入出力の練習問題(テスト用)
ユーザー vjudge1
提出日時 2025-11-24 21:15:24
言語 Crystal
(1.14.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 783 bytes
コンパイル時間 17,187 ms
コンパイル使用メモリ 345,524 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2025-11-24 21:15:42
合計ジャッジ時間 16,522 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 2
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

lib C
    fun getchar_unlocked : Int32
end
def read_i : Int32
    ans = 0
    f = 1
    c = C.getchar_unlocked()
    while [9, 10, 11, 12, 13, 32].includes?(c)
        c = C.getchar_unlocked()
    end
    if c == 45
        f = -1
        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
def read_word : String
    ans = [] of Char
    f = 1
    c = C.getchar_unlocked()
    while [9, 10, 11, 12, 13, 32].includes?(c)
        c = C.getchar_unlocked()
    end
    while ![-1, 9, 10, 11, 12, 13, 32].includes?(c)
        ans.push('\0' + c)
        c = C.getchar_unlocked()
    end
    return ans.join("")
end
printf("%d %s\n", read_i + read_i, read_word)
0