結果

問題 No.71 そろばん
ユーザー kuramukuramu
提出日時 2016-02-07 00:47:11
言語 Java21
(openjdk 21)
結果
AC  
実行時間 57 ms / 5,000 ms
コード長 657 bytes
コンパイル時間 2,144 ms
コンパイル使用メモリ 74,684 KB
実行使用メモリ 53,652 KB
最終ジャッジ日時 2023-10-21 19:34:01
合計ジャッジ時間 4,288 ms
ジャッジサーバーID
(参考情報)
judge10 / judge9
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 55 ms
53,640 KB
testcase_01 AC 55 ms
53,636 KB
testcase_02 AC 54 ms
53,636 KB
testcase_03 AC 55 ms
53,652 KB
testcase_04 AC 57 ms
52,608 KB
testcase_05 AC 54 ms
52,620 KB
testcase_06 AC 55 ms
53,644 KB
testcase_07 AC 57 ms
53,652 KB
testcase_08 AC 55 ms
53,636 KB
testcase_09 AC 55 ms
50,552 KB
testcase_10 AC 55 ms
52,576 KB
testcase_11 AC 55 ms
53,632 KB
testcase_12 AC 55 ms
53,636 KB
testcase_13 AC 57 ms
53,624 KB
testcase_14 AC 55 ms
53,632 KB
testcase_15 AC 57 ms
53,640 KB
testcase_16 AC 55 ms
52,632 KB
testcase_17 AC 56 ms
52,556 KB
testcase_18 AC 57 ms
52,592 KB
testcase_19 AC 56 ms
53,628 KB
testcase_20 AC 57 ms
53,640 KB
testcase_21 AC 55 ms
52,628 KB
testcase_22 AC 55 ms
52,604 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;
public class Main {

	 public static void main(String[] args) {
	      BufferedReader stdReader =new BufferedReader(new InputStreamReader(System.in));
	      try {
	    	  BigInteger num = BigInteger.valueOf(Long.parseLong(stdReader.readLine()));
	    	  BigInteger up = num.divide(BigInteger.valueOf(2));
	    	  BigInteger down = num.subtract(up);
	    	  BigInteger ans = up.multiply(down.add(BigInteger.valueOf(1))).add(down);
	    	  System.out.println(ans);
	      } catch (IOException e) {
			e.printStackTrace();
	      }
	}
}
0