結果

問題 No.276 連続する整数の和(1)
ユーザー aaaaasatoriaaaaasatori
提出日時 2018-02-20 23:02:27
言語 Java21
(openjdk 21)
結果
AC  
実行時間 123 ms / 1,000 ms
コード長 247 bytes
コンパイル時間 4,097 ms
コンパイル使用メモリ 71,244 KB
実行使用メモリ 56,280 KB
最終ジャッジ日時 2023-10-11 13:41:05
合計ジャッジ時間 5,452 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
55,760 KB
testcase_01 AC 120 ms
55,648 KB
testcase_02 AC 120 ms
55,712 KB
testcase_03 AC 121 ms
55,776 KB
testcase_04 AC 120 ms
55,652 KB
testcase_05 AC 121 ms
56,280 KB
testcase_06 AC 123 ms
56,256 KB
testcase_07 AC 123 ms
56,104 KB
testcase_08 AC 119 ms
55,972 KB
testcase_09 AC 121 ms
56,164 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

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