結果

問題 No.1822 Keima of Shogi
ユーザー koanviolinkoanviolin
提出日時 2022-01-28 21:37:52
言語 Java21
(openjdk 21)
結果
AC  
実行時間 117 ms / 2,000 ms
コード長 278 bytes
コンパイル時間 1,854 ms
コンパイル使用メモリ 70,824 KB
実行使用メモリ 56,440 KB
最終ジャッジ日時 2023-08-28 19:23:27
合計ジャッジ時間 3,742 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 116 ms
55,980 KB
testcase_01 AC 114 ms
56,424 KB
testcase_02 AC 114 ms
55,920 KB
testcase_03 AC 115 ms
55,656 KB
testcase_04 AC 115 ms
56,012 KB
testcase_05 AC 114 ms
55,784 KB
testcase_06 AC 114 ms
55,788 KB
testcase_07 AC 115 ms
56,440 KB
testcase_08 AC 117 ms
56,136 KB
testcase_09 AC 116 ms
56,308 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedInputStream;
import java.util.*;

public class Main {
   
    public static void main(String[] argv){
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        long k = n / 2 +1;
        System.out.println(k*(k+1)/2);


    }
}
0