結果

問題 No.72 そろばん Med
ユーザー kohaku_kohaku
提出日時 2016-12-03 21:58:23
言語 Java
(openjdk 23)
結果
AC  
実行時間 139 ms / 5,000 ms
コード長 390 bytes
コンパイル時間 2,543 ms
コンパイル使用メモリ 74,132 KB
実行使用メモリ 54,812 KB
最終ジャッジ日時 2024-11-21 11:59:25
合計ジャッジ時間 7,124 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 24
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long N = sc.nextLong();
        long mod = (long)Math.pow(10,6)+7;
        long half = N/2;
        long a = (N-half)%mod;
        long b = (half+1)%mod;
        long c = half%mod;
        long max=(a*b+c)%mod;
        System.out.println(max);
    }
}
0