結果

問題 No.480 合計
ユーザー vjudge1
提出日時 2025-06-13 17:21:00
言語 Crystal
(1.14.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 462 bytes
コンパイル時間 14,864 ms
コンパイル使用メモリ 306,792 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2025-06-13 17:21:16
合計ジャッジ時間 15,505 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

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 = -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
a = read_int
puts (a + 1) * a >> 1
0