結果

問題 No.71 そろばん
ユーザー ぴろずぴろず
提出日時 2014-12-11 16:00:29
言語 Java21
(openjdk 21)
結果
AC  
実行時間 126 ms / 5,000 ms
コード長 416 bytes
コンパイル時間 2,316 ms
コンパイル使用メモリ 71,572 KB
実行使用メモリ 56,304 KB
最終ジャッジ日時 2023-09-02 13:59:47
合計ジャッジ時間 6,264 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
55,824 KB
testcase_01 AC 123 ms
55,428 KB
testcase_02 AC 126 ms
55,796 KB
testcase_03 AC 123 ms
55,640 KB
testcase_04 AC 122 ms
55,668 KB
testcase_05 AC 125 ms
55,640 KB
testcase_06 AC 125 ms
55,736 KB
testcase_07 AC 124 ms
55,784 KB
testcase_08 AC 124 ms
55,580 KB
testcase_09 AC 122 ms
55,764 KB
testcase_10 AC 124 ms
55,444 KB
testcase_11 AC 123 ms
55,804 KB
testcase_12 AC 126 ms
55,792 KB
testcase_13 AC 124 ms
55,732 KB
testcase_14 AC 122 ms
56,000 KB
testcase_15 AC 122 ms
56,000 KB
testcase_16 AC 123 ms
55,844 KB
testcase_17 AC 125 ms
55,824 KB
testcase_18 AC 122 ms
55,796 KB
testcase_19 AC 121 ms
55,428 KB
testcase_20 AC 123 ms
55,724 KB
testcase_21 AC 126 ms
56,304 KB
testcase_22 AC 124 ms
56,272 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package no072;

import java.math.BigInteger;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		BigInteger n = new BigInteger(sc.next());
		BigInteger half = n.divide(new BigInteger("2"));
		System.out.println(
				half.add(BigInteger.ONE).multiply(n.subtract(half).add(BigInteger.ONE)).subtract(BigInteger.ONE));
	}

}
0