結果

問題 No.276 連続する整数の和(1)
ユーザー GrenacheGrenache
提出日時 2015-09-04 22:33:02
言語 Java17
(openjdk 17.0.1)
結果
AC  
実行時間 98 ms / 1,000 ms
コード長 399 bytes
コンパイル時間 3,188 ms
使用メモリ 37,556 KB
最終ジャッジ日時 2023-02-17 02:20:49
合計ジャッジ時間 5,093 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 93 ms
37,556 KB
testcase_01 AC 94 ms
37,152 KB
testcase_02 AC 95 ms
37,536 KB
testcase_03 AC 96 ms
37,268 KB
testcase_04 AC 98 ms
37,232 KB
testcase_05 AC 96 ms
37,164 KB
testcase_06 AC 95 ms
37,268 KB
testcase_07 AC 95 ms
37,192 KB
testcase_08 AC 98 ms
37,280 KB
testcase_09 AC 94 ms
37,224 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;


public class Main_yukicoder276 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        long n = sc.nextLong();

        if (n == 1) {
        	System.out.println("1");
        } else if (n % 2 == 1) {
        	System.out.println(n);
        } else {
        	System.out.println(n / 2);
        }

        sc.close();
    }
}
0