結果

問題 No.276 連続する整数の和(1)
ユーザー tsunabittsunabit
提出日時 2020-03-21 23:16:00
言語 Java17
(openjdk 17.0.1)
結果
AC  
実行時間 100 ms / 1,000 ms
コード長 261 bytes
コンパイル時間 2,688 ms
使用メモリ 50,996 KB
最終ジャッジ日時 2023-01-13 06:27:01
合計ジャッジ時間 4,613 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 94 ms
50,956 KB
testcase_01 AC 95 ms
50,852 KB
testcase_02 AC 93 ms
50,880 KB
testcase_03 AC 97 ms
50,880 KB
testcase_04 AC 97 ms
50,824 KB
testcase_05 AC 99 ms
50,972 KB
testcase_06 AC 94 ms
50,996 KB
testcase_07 AC 94 ms
50,860 KB
testcase_08 AC 94 ms
50,968 KB
testcase_09 AC 100 ms
50,884 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.io.*;
import java.math.*;

public class No276 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		if(n % 2 == 0) System.out.println(n/2);
		else System.out.println(n);
	}
}
0