結果

問題 No.276 連続する整数の和(1)
ユーザー tsunabittsunabit
提出日時 2020-03-21 23:16:00
言語 Java21
(openjdk 21)
結果
AC  
実行時間 123 ms / 1,000 ms
コード長 261 bytes
コンパイル時間 3,636 ms
コンパイル使用メモリ 71,872 KB
実行使用メモリ 56,400 KB
最終ジャッジ日時 2023-08-25 15:17:05
合計ジャッジ時間 5,689 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
56,192 KB
testcase_01 AC 121 ms
56,008 KB
testcase_02 AC 123 ms
55,888 KB
testcase_03 AC 122 ms
56,052 KB
testcase_04 AC 120 ms
55,836 KB
testcase_05 AC 121 ms
55,988 KB
testcase_06 AC 121 ms
55,836 KB
testcase_07 AC 122 ms
56,400 KB
testcase_08 AC 119 ms
55,548 KB
testcase_09 AC 119 ms
55,912 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