結果

問題 No.276 連続する整数の和(1)
ユーザー nanophoto12nanophoto12
提出日時 2015-09-13 11:55:03
言語 Java21
(openjdk 21)
結果
AC  
実行時間 125 ms / 1,000 ms
コード長 393 bytes
コンパイル時間 3,829 ms
コンパイル使用メモリ 71,260 KB
実行使用メモリ 56,036 KB
最終ジャッジ日時 2023-09-26 11:44:09
合計ジャッジ時間 4,458 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 124 ms
56,036 KB
testcase_01 AC 125 ms
55,780 KB
testcase_02 AC 124 ms
55,684 KB
testcase_03 AC 124 ms
55,608 KB
testcase_04 AC 124 ms
55,580 KB
testcase_05 AC 122 ms
55,996 KB
testcase_06 AC 124 ms
55,816 KB
testcase_07 AC 123 ms
55,576 KB
testcase_08 AC 122 ms
55,724 KB
testcase_09 AC 123 ms
55,420 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package com.company;

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Integer value = new Scanner(System.in).nextInt();
        if(value % 2 == 1)
        {
            System.out.println(value.toString());
            return;
        }
        Integer half = value / 2;
        System.out.println(half.toString());
        return;
    }
}
0