結果

問題 No.1822 Keima of Shogi
ユーザー ks2mks2m
提出日時 2022-01-28 22:08:34
言語 Java21
(openjdk 21)
結果
AC  
実行時間 127 ms / 2,000 ms
コード長 274 bytes
コンパイル時間 4,445 ms
コンパイル使用メモリ 71,276 KB
実行使用メモリ 56,016 KB
最終ジャッジ日時 2023-08-28 20:07:52
合計ジャッジ時間 3,998 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
55,364 KB
testcase_01 AC 124 ms
55,924 KB
testcase_02 AC 124 ms
55,828 KB
testcase_03 AC 125 ms
56,016 KB
testcase_04 AC 125 ms
55,664 KB
testcase_05 AC 125 ms
55,724 KB
testcase_06 AC 124 ms
55,676 KB
testcase_07 AC 124 ms
55,876 KB
testcase_08 AC 127 ms
56,008 KB
testcase_09 AC 125 ms
55,832 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		long n = sc.nextInt();
		sc.close();

		long n2 = (n + 1) / 2;
		long ans = n2 * (n2 + 1) / 2;
		System.out.println(ans);
	}
}
0