結果

問題 No.480 合計
ユーザー tanson
提出日時 2025-06-25 23:34:47
言語 Standard ML
(MLton 20210117)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 285 bytes
コンパイル時間 5,407 ms
コンパイル使用メモリ 686,976 KB
実行使用メモリ 7,848 KB
最終ジャッジ日時 2025-06-25 23:34:54
合計ジャッジ時間 5,321 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

fun readInt () =
    valOf (TextIO.scanStream (Int.scan StringCvt.DEC) TextIO.stdIn)

fun int_string n =
    if 0 <= n
    then Int.toString n
    else "-" ^ Int.toString (abs n)

val () =
    let
        val n = readInt ()
    in
        print (int_string (n * (n + 1) div 2))
    end
0