結果

問題 No.72 そろばん Med
ユーザー kou6839kou6839
提出日時 2014-12-21 16:30:08
言語 Java21
(openjdk 21)
結果
AC  
実行時間 133 ms / 5,000 ms
コード長 478 bytes
コンパイル時間 1,997 ms
コンパイル使用メモリ 76,332 KB
実行使用メモリ 41,880 KB
最終ジャッジ日時 2024-05-01 08:35:45
合計ジャッジ時間 5,941 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 117 ms
41,636 KB
testcase_01 AC 118 ms
41,488 KB
testcase_02 AC 119 ms
41,244 KB
testcase_03 AC 107 ms
41,396 KB
testcase_04 AC 112 ms
41,444 KB
testcase_05 AC 106 ms
41,632 KB
testcase_06 AC 117 ms
40,288 KB
testcase_07 AC 112 ms
41,416 KB
testcase_08 AC 107 ms
41,384 KB
testcase_09 AC 115 ms
41,724 KB
testcase_10 AC 109 ms
41,656 KB
testcase_11 AC 117 ms
41,436 KB
testcase_12 AC 113 ms
41,412 KB
testcase_13 AC 120 ms
41,328 KB
testcase_14 AC 123 ms
41,264 KB
testcase_15 AC 116 ms
41,524 KB
testcase_16 AC 118 ms
41,260 KB
testcase_17 AC 106 ms
41,676 KB
testcase_18 AC 105 ms
41,404 KB
testcase_19 AC 133 ms
41,536 KB
testcase_20 AC 127 ms
41,880 KB
testcase_21 AC 120 ms
40,428 KB
testcase_22 AC 106 ms
41,352 KB
testcase_23 AC 110 ms
41,320 KB
testcase_24 AC 122 ms
41,300 KB
testcase_25 AC 117 ms
41,296 KB
testcase_26 AC 104 ms
41,708 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        long si = n/2;
        long ue = n-si;
        BigInteger a = new BigInteger(si+"");
        BigInteger aa = a.add(new BigInteger("1"));
        BigInteger b = aa.multiply(new BigInteger(ue+""));
        b = b.add(a);
        System.out.println(b.mod(new BigInteger("1000007")));
    }
}
0