結果

問題 No.523 LED
ユーザー tentententen
提出日時 2021-11-02 12:47:58
言語 Java21
(openjdk 21)
結果
AC  
実行時間 173 ms / 2,000 ms
コード長 1,157 bytes
コンパイル時間 2,620 ms
コンパイル使用メモリ 74,812 KB
実行使用メモリ 37,780 KB
最終ジャッジ日時 2024-04-19 19:29:54
合計ジャッジ時間 5,872 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 58 ms
36,800 KB
testcase_01 AC 56 ms
36,736 KB
testcase_02 AC 68 ms
37,068 KB
testcase_03 AC 58 ms
36,752 KB
testcase_04 AC 58 ms
37,084 KB
testcase_05 AC 169 ms
37,512 KB
testcase_06 AC 59 ms
37,000 KB
testcase_07 AC 56 ms
37,064 KB
testcase_08 AC 60 ms
36,820 KB
testcase_09 AC 64 ms
36,944 KB
testcase_10 AC 55 ms
37,060 KB
testcase_11 AC 58 ms
36,808 KB
testcase_12 AC 58 ms
37,060 KB
testcase_13 AC 93 ms
37,396 KB
testcase_14 AC 62 ms
36,812 KB
testcase_15 AC 61 ms
36,940 KB
testcase_16 AC 60 ms
36,820 KB
testcase_17 AC 59 ms
37,032 KB
testcase_18 AC 173 ms
37,504 KB
testcase_19 AC 109 ms
37,388 KB
testcase_20 AC 97 ms
37,676 KB
testcase_21 AC 139 ms
37,732 KB
testcase_22 AC 147 ms
37,388 KB
testcase_23 AC 163 ms
37,780 KB
testcase_24 AC 75 ms
37,520 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

public class Main {
    static final int MOD = 1000000007;
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner();
        int n = sc.nextInt();
        long ans = 1;
        for (int i = 1; i <= n * 2; i++) {
            if (i % 2 == 0) {
                ans *= i / 2;
            } else {
                ans *= i;
            }
            ans %= MOD;
        }
        System.out.println(ans);
    }
}
class Scanner {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    StringTokenizer st = new StringTokenizer("");
    
    public Scanner() throws Exception {
        
    }
    
    public int nextInt() throws Exception {
        return Integer.parseInt(next());
    }
    
    public long nextLong() throws Exception {
        return Long.parseLong(next());
    }
    
    public String nextLine() throws Exception {
        return br.readLine();
    }
    
    public String next() throws Exception {
        if (!st.hasMoreTokens()) {
            st = new StringTokenizer(br.readLine());
        }
        return st.nextToken();
    }
}
0