結果

問題 No.276 連続する整数の和(1)
ユーザー mits58mits58
提出日時 2016-05-05 15:27:38
言語 Java21
(openjdk 21)
結果
AC  
実行時間 141 ms / 1,000 ms
コード長 289 bytes
コンパイル時間 2,550 ms
コンパイル使用メモリ 74,656 KB
実行使用メモリ 54,392 KB
最終ジャッジ日時 2024-04-15 13:15:09
合計ジャッジ時間 4,491 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 140 ms
54,248 KB
testcase_01 AC 139 ms
54,040 KB
testcase_02 AC 138 ms
54,392 KB
testcase_03 AC 138 ms
54,080 KB
testcase_04 AC 137 ms
54,260 KB
testcase_05 AC 140 ms
54,168 KB
testcase_06 AC 136 ms
54,036 KB
testcase_07 AC 139 ms
54,048 KB
testcase_08 AC 141 ms
54,124 KB
testcase_09 AC 138 ms
54,172 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

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