結果

問題 No.276 連続する整数の和(1)
ユーザー gu_21816943gu_21816943
提出日時 2017-06-27 02:18:17
言語 Java21
(openjdk 21)
結果
AC  
実行時間 59 ms / 1,000 ms
コード長 395 bytes
コンパイル時間 2,260 ms
コンパイル使用メモリ 74,008 KB
実行使用メモリ 37,292 KB
最終ジャッジ日時 2024-04-15 02:04:48
合計ジャッジ時間 3,281 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 57 ms
37,292 KB
testcase_01 AC 55 ms
36,968 KB
testcase_02 AC 55 ms
37,128 KB
testcase_03 AC 56 ms
36,984 KB
testcase_04 AC 59 ms
36,896 KB
testcase_05 AC 57 ms
36,876 KB
testcase_06 AC 55 ms
37,248 KB
testcase_07 AC 54 ms
37,120 KB
testcase_08 AC 56 ms
37,132 KB
testcase_09 AC 54 ms
37,144 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int num = Integer.parseInt(br.readLine());
		br.close();
		if(num%2==0){
			System.out.println(num/2);
		}else{
			System.out.println(num);
		}

	}
}
0