結果

問題 No.523 LED
ユーザー 37zigen37zigen
提出日時 2020-03-22 05:22:30
言語 Java21
(openjdk 21)
結果
AC  
実行時間 1,840 ms / 2,000 ms
コード長 820 bytes
コンパイル時間 2,099 ms
コンパイル使用メモリ 74,280 KB
実行使用メモリ 56,420 KB
最終ジャッジ日時 2023-08-26 02:10:28
合計ジャッジ時間 16,344 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
56,076 KB
testcase_01 AC 122 ms
56,048 KB
testcase_02 AC 155 ms
56,420 KB
testcase_03 AC 122 ms
56,128 KB
testcase_04 AC 123 ms
55,992 KB
testcase_05 AC 1,840 ms
55,672 KB
testcase_06 AC 122 ms
56,120 KB
testcase_07 AC 120 ms
54,080 KB
testcase_08 AC 123 ms
56,180 KB
testcase_09 AC 148 ms
56,244 KB
testcase_10 AC 123 ms
56,124 KB
testcase_11 AC 123 ms
55,964 KB
testcase_12 AC 123 ms
56,124 KB
testcase_13 AC 461 ms
53,952 KB
testcase_14 AC 123 ms
55,960 KB
testcase_15 AC 130 ms
55,952 KB
testcase_16 AC 123 ms
56,004 KB
testcase_17 AC 128 ms
56,036 KB
testcase_18 AC 1,837 ms
56,076 KB
testcase_19 AC 739 ms
55,896 KB
testcase_20 AC 670 ms
56,348 KB
testcase_21 AC 1,416 ms
55,572 KB
testcase_22 AC 1,565 ms
55,612 KB
testcase_23 AC 1,567 ms
56,376 KB
testcase_24 AC 168 ms
56,244 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.FileNotFoundException;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws FileNotFoundException {
		long t = System.currentTimeMillis();
		new Main().run();
		System.err.println(System.currentTimeMillis() - t);
	}
	
	long inv(long a) {
		return pow(a,MOD-2);
	}
	
	long pow(long a,long n) {
		long ret=1;
		for(;n>0;n>>=1,a=a*a%MOD)if(n%2==1)ret=ret*a%MOD;
		return ret;
	}
	
	final long MOD=(long)1e9+7;
	
	void run() {
		Scanner sc = new Scanner(System.in);
		int N=sc.nextInt();
		long ans=1;
		for(long i=1;i<=2*N;++i)ans=ans*i%MOD;
		for(long i=1;i<=N;++i)ans=ans*inv(2)%MOD;
		System.out.println(ans);
	}


	static void tr(Object... objects) {
		System.out.println(Arrays.deepToString(objects));
	}

}
0