結果

問題 No.276 連続する整数の和(1)
ユーザー GrenacheGrenache
提出日時 2015-09-04 22:33:02
言語 Java21
(openjdk 21)
結果
AC  
実行時間 126 ms / 1,000 ms
コード長 399 bytes
コンパイル時間 3,438 ms
コンパイル使用メモリ 72,396 KB
実行使用メモリ 55,980 KB
最終ジャッジ日時 2023-09-26 05:33:26
合計ジャッジ時間 5,622 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
55,556 KB
testcase_01 AC 121 ms
55,544 KB
testcase_02 AC 120 ms
55,548 KB
testcase_03 AC 122 ms
55,780 KB
testcase_04 AC 126 ms
55,684 KB
testcase_05 AC 126 ms
55,720 KB
testcase_06 AC 123 ms
55,980 KB
testcase_07 AC 122 ms
55,744 KB
testcase_08 AC 124 ms
55,760 KB
testcase_09 AC 123 ms
55,312 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