結果

問題 No.276 連続する整数の和(1)
ユーザー htensaihtensai
提出日時 2019-11-23 14:45:37
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 192 bytes
コンパイル時間 2,223 ms
コンパイル使用メモリ 74,224 KB
実行使用メモリ 56,272 KB
最終ジャッジ日時 2024-04-19 14:40:53
合計ジャッジ時間 4,114 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 108 ms
41,384 KB
testcase_01 AC 110 ms
39,820 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		long n = sc.nextInt();
		System.out.println(n * (n - 1) / 2);
	}
}
0