結果

問題 No.276 連続する整数の和(1)
ユーザー mits58mits58
提出日時 2016-05-05 15:27:45
言語 Java21
(openjdk 21)
結果
AC  
実行時間 140 ms / 1,000 ms
コード長 289 bytes
コンパイル時間 2,253 ms
コンパイル使用メモリ 73,864 KB
実行使用メモリ 54,588 KB
最終ジャッジ日時 2024-04-15 13:15:15
合計ジャッジ時間 4,083 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 140 ms
54,088 KB
testcase_01 AC 133 ms
53,860 KB
testcase_02 AC 135 ms
54,136 KB
testcase_03 AC 137 ms
54,284 KB
testcase_04 AC 135 ms
54,588 KB
testcase_05 AC 133 ms
53,952 KB
testcase_06 AC 133 ms
54,220 KB
testcase_07 AC 135 ms
54,232 KB
testcase_08 AC 133 ms
54,292 KB
testcase_09 AC 132 ms
53,956 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