結果

問題 No.276 連続する整数の和(1)
ユーザー hhgfhn1hhgfhn1
提出日時 2018-10-29 16:15:22
言語 Java21
(openjdk 21)
結果
AC  
実行時間 112 ms / 1,000 ms
コード長 235 bytes
コンパイル時間 2,878 ms
コンパイル使用メモリ 74,248 KB
実行使用メモリ 41,344 KB
最終ジャッジ日時 2024-04-29 22:46:36
合計ジャッジ時間 3,839 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 102 ms
41,052 KB
testcase_01 AC 105 ms
41,084 KB
testcase_02 AC 112 ms
41,344 KB
testcase_03 AC 109 ms
40,060 KB
testcase_04 AC 103 ms
41,084 KB
testcase_05 AC 109 ms
39,716 KB
testcase_06 AC 106 ms
39,892 KB
testcase_07 AC 99 ms
40,780 KB
testcase_08 AC 108 ms
41,072 KB
testcase_09 AC 112 ms
40,908 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {

	@SuppressWarnings("resource")
	public static void main(String args[]) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		System.out.println(n%2==0?n/2:n);
	}
}
0