結果

問題 No.276 連続する整数の和(1)
ユーザー TatsuDXTatsuDX
提出日時 2016-10-16 22:24:40
言語 Java21
(openjdk 21)
結果
AC  
実行時間 115 ms / 1,000 ms
コード長 261 bytes
コンパイル時間 3,211 ms
コンパイル使用メモリ 71,804 KB
実行使用メモリ 56,336 KB
最終ジャッジ日時 2023-08-14 14:42:17
合計ジャッジ時間 4,939 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 115 ms
56,268 KB
testcase_01 AC 112 ms
56,256 KB
testcase_02 AC 109 ms
56,300 KB
testcase_03 AC 105 ms
56,336 KB
testcase_04 AC 105 ms
56,128 KB
testcase_05 AC 105 ms
55,852 KB
testcase_06 AC 108 ms
56,104 KB
testcase_07 AC 101 ms
55,868 KB
testcase_08 AC 104 ms
55,816 KB
testcase_09 AC 104 ms
56,100 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Test {
	public static Scanner sc = new Scanner(System.in);

	public static void main(String[] args) {
		int n = sc.nextInt();
		if (n % 2 == 1) {
			System.out.println(n);
		} else {
			System.out.println(n / 2);
		}
	}
}
0