結果

問題 No.480 合計
ユーザー mlpj56d
提出日時 2017-06-18 23:13:32
言語 JavaScript
(node v23.5.0)
結果
WA  
実行時間 -
コード長 218 bytes
コンパイル時間 50 ms
コンパイル使用メモリ 6,816 KB
実行使用メモリ 39,664 KB
最終ジャッジ日時 2024-10-13 00:09:19
合計ジャッジ時間 1,819 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other WA * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

function Main (input) {
    var n = parseInt(input) ;
    var s = 0;
    if ( n % 2 == 0) {
        s = (1 + n) * n / 2
        console.log(s)
} else {
    s = (1 + n) * (n - 1) / 2 + (1 + n) / 2
    console.log(s)
}
}
0