結果

問題 No.72 そろばん Med
ユーザー kou6839
提出日時 2014-12-21 16:30:08
言語 Java
(openjdk 23)
結果
AC  
実行時間 144 ms / 5,000 ms
コード長 478 bytes
コンパイル時間 2,350 ms
コンパイル使用メモリ 86,604 KB
実行使用メモリ 54,400 KB
最終ジャッジ日時 2024-11-21 11:39:30
合計ジャッジ時間 6,848 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 24
権限があれば一括ダウンロードができます

ソースコード

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