結果

問題 No.523 LED
ユーザー tentententen
提出日時 2020-09-10 09:59:12
言語 Java21
(openjdk 21)
結果
AC  
実行時間 232 ms / 2,000 ms
コード長 422 bytes
コンパイル時間 1,992 ms
コンパイル使用メモリ 71,900 KB
実行使用メモリ 56,192 KB
最終ジャッジ日時 2023-08-23 13:03:47
合計ジャッジ時間 7,171 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 119 ms
55,360 KB
testcase_01 AC 121 ms
55,824 KB
testcase_02 AC 132 ms
55,892 KB
testcase_03 AC 121 ms
56,192 KB
testcase_04 AC 121 ms
55,816 KB
testcase_05 AC 232 ms
56,128 KB
testcase_06 AC 122 ms
55,992 KB
testcase_07 AC 123 ms
55,796 KB
testcase_08 AC 120 ms
56,092 KB
testcase_09 AC 128 ms
56,100 KB
testcase_10 AC 121 ms
55,936 KB
testcase_11 AC 121 ms
55,968 KB
testcase_12 AC 127 ms
55,812 KB
testcase_13 AC 154 ms
55,728 KB
testcase_14 AC 130 ms
55,720 KB
testcase_15 AC 132 ms
55,380 KB
testcase_16 AC 125 ms
55,416 KB
testcase_17 AC 120 ms
55,968 KB
testcase_18 AC 230 ms
55,972 KB
testcase_19 AC 163 ms
55,944 KB
testcase_20 AC 160 ms
55,756 KB
testcase_21 AC 204 ms
55,648 KB
testcase_22 AC 216 ms
55,808 KB
testcase_23 AC 217 ms
55,616 KB
testcase_24 AC 135 ms
55,660 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    static final int MOD = 1000000007;
	public static void main (String[] args) {
    	Scanner sc = new Scanner(System.in);
    	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);
    }
}
0