結果

問題 No.72 そろばん Med
ユーザー htensaihtensai
提出日時 2019-12-06 12:33:55
言語 Java21
(openjdk 21)
結果
AC  
実行時間 120 ms / 5,000 ms
コード長 380 bytes
コンパイル時間 4,688 ms
コンパイル使用メモリ 71,024 KB
実行使用メモリ 39,984 KB
最終ジャッジ日時 2023-08-24 19:50:24
合計ジャッジ時間 6,421 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 116 ms
39,524 KB
testcase_01 AC 117 ms
39,724 KB
testcase_02 AC 116 ms
39,584 KB
testcase_03 AC 115 ms
39,480 KB
testcase_04 AC 118 ms
39,184 KB
testcase_05 AC 118 ms
39,156 KB
testcase_06 AC 116 ms
39,680 KB
testcase_07 AC 115 ms
39,284 KB
testcase_08 AC 115 ms
39,308 KB
testcase_09 AC 115 ms
39,500 KB
testcase_10 AC 115 ms
39,284 KB
testcase_11 AC 116 ms
39,876 KB
testcase_12 AC 120 ms
39,372 KB
testcase_13 AC 112 ms
39,152 KB
testcase_14 AC 112 ms
39,296 KB
testcase_15 AC 118 ms
39,316 KB
testcase_16 AC 114 ms
39,436 KB
testcase_17 AC 113 ms
39,076 KB
testcase_18 AC 115 ms
39,160 KB
testcase_19 AC 115 ms
39,056 KB
testcase_20 AC 115 ms
39,152 KB
testcase_21 AC 113 ms
39,984 KB
testcase_22 AC 117 ms
39,252 KB
testcase_23 AC 114 ms
39,476 KB
testcase_24 AC 113 ms
39,348 KB
testcase_25 AC 115 ms
39,492 KB
testcase_26 AC 115 ms
39,244 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

public class Main {
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		BigInteger mod = BigInteger.valueOf(1000007);
		long n = sc.nextLong();
		BigInteger ans = BigInteger.valueOf(n / 2 + 1).multiply(BigInteger.valueOf(n - n / 2 + 1)).subtract(BigInteger.ONE).mod(mod);
		System.out.println(ans);
   }
}

0