結果

問題 No.523 LED
ユーザー htensaihtensai
提出日時 2020-01-29 09:46:12
言語 Java21
(openjdk 21)
結果
AC  
実行時間 158 ms / 2,000 ms
コード長 551 bytes
コンパイル時間 3,163 ms
コンパイル使用メモリ 72,296 KB
実行使用メモリ 34,392 KB
最終ジャッジ日時 2023-10-14 00:22:09
合計ジャッジ時間 6,513 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
33,204 KB
testcase_01 AC 40 ms
33,256 KB
testcase_02 AC 51 ms
33,308 KB
testcase_03 AC 40 ms
33,300 KB
testcase_04 AC 42 ms
33,272 KB
testcase_05 AC 158 ms
34,384 KB
testcase_06 AC 40 ms
33,204 KB
testcase_07 AC 40 ms
33,180 KB
testcase_08 AC 40 ms
33,492 KB
testcase_09 AC 46 ms
33,432 KB
testcase_10 AC 40 ms
33,748 KB
testcase_11 AC 41 ms
33,328 KB
testcase_12 AC 40 ms
33,620 KB
testcase_13 AC 73 ms
34,392 KB
testcase_14 AC 41 ms
33,756 KB
testcase_15 AC 41 ms
33,492 KB
testcase_16 AC 41 ms
33,204 KB
testcase_17 AC 41 ms
33,620 KB
testcase_18 AC 158 ms
34,128 KB
testcase_19 AC 89 ms
34,080 KB
testcase_20 AC 84 ms
34,092 KB
testcase_21 AC 130 ms
34,376 KB
testcase_22 AC 144 ms
33,896 KB
testcase_23 AC 140 ms
34,016 KB
testcase_24 AC 53 ms
34,060 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.io.*;

public class Main {
    static final int MOD = 1000000007;
    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        long ans = 1;
        for (int i = 1; i <= 2 * n; i++) {
            if (i % 2 == 0) {
                ans *= i / 2;
            } else {
                ans *= i;
            }
            ans %= MOD;
        }
        System.out.println(ans);
    }
}
0