結果

問題 No.523 LED
ユーザー tentententen
提出日時 2022-08-10 16:55:39
言語 Java21
(openjdk 21)
結果
MLE  
実行時間 -
コード長 1,390 bytes
コンパイル時間 3,587 ms
コンパイル使用メモリ 76,996 KB
実行使用メモリ 822,996 KB
最終ジャッジ日時 2023-10-21 02:39:04
合計ジャッジ時間 6,671 ms
ジャッジサーバーID
(参考情報)
judge10 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 55 ms
53,528 KB
testcase_01 AC 54 ms
53,604 KB
testcase_02 AC 70 ms
69,448 KB
testcase_03 AC 54 ms
51,496 KB
testcase_04 AC 51 ms
53,608 KB
testcase_05 MLE -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
権限があれば一括ダウンロードができます

ソースコード

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();
        System.out.println(proc(n * 2) * pow(pow(2, n), MOD - 2) % MOD);
    }
    
    static long proc(int x) {
        if (x == 0) {
            return 1;
        } else {
            return proc(x - 1) * x % MOD;
        }
    }
    
    static long pow(long x, int p) {
        if (p == 0) {
            return 1;
        } else if (p % 2 == 0) {
            return pow(x * x % MOD, p / 2);
        } else {
            return pow(x, p - 1) * x % MOD;
        }
    }
}

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 double nextDouble() throws Exception {
        return Double.parseDouble(next());
    }
    
    public String next() throws Exception {
        while (!st.hasMoreTokens()) {
            st = new StringTokenizer(br.readLine());
        }
        return st.nextToken();
    }
}
0