結果

問題 No.276 連続する整数の和(1)
ユーザー YamaKasaYamaKasa
提出日時 2018-09-08 20:27:22
言語 Java17
(openjdk 17.0.1)
結果
AC  
実行時間 106 ms / 1,000 ms
コード長 267 bytes
コンパイル時間 2,669 ms
使用メモリ 51,096 KB
最終ジャッジ日時 2023-01-09 16:21:46
合計ジャッジ時間 3,660 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 100 ms
48,776 KB
testcase_01 AC 100 ms
48,920 KB
testcase_02 AC 104 ms
51,020 KB
testcase_03 AC 104 ms
48,964 KB
testcase_04 AC 100 ms
48,984 KB
testcase_05 AC 98 ms
49,020 KB
testcase_06 AC 97 ms
51,096 KB
testcase_07 AC 103 ms
50,928 KB
testcase_08 AC 106 ms
48,988 KB
testcase_09 AC 99 ms
48,980 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		long N = scan.nextLong();
		scan.close();
		if(N % 2 == 1) {
			System.out.println(N);
		}else {
			System.out.println(N / 2);
		}
	}
}
0