結果

問題 No.523 LED
ユーザー makecirmakecir
提出日時 2017-06-19 17:51:12
言語 C
(gcc 12.3.0)
結果
AC  
実行時間 140 ms / 2,000 ms
コード長 441 bytes
コンパイル時間 191 ms
コンパイル使用メモリ 31,104 KB
実行使用メモリ 95,616 KB
最終ジャッジ日時 2024-04-10 06:06:40
合計ジャッジ時間 1,988 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,812 KB
testcase_01 AC 1 ms
6,944 KB
testcase_02 AC 3 ms
6,944 KB
testcase_03 AC 1 ms
6,940 KB
testcase_04 AC 1 ms
6,940 KB
testcase_05 AC 139 ms
95,488 KB
testcase_06 AC 1 ms
6,944 KB
testcase_07 AC 1 ms
6,944 KB
testcase_08 AC 1 ms
6,940 KB
testcase_09 AC 2 ms
6,940 KB
testcase_10 AC 1 ms
6,944 KB
testcase_11 AC 1 ms
6,944 KB
testcase_12 AC 1 ms
6,940 KB
testcase_13 AC 27 ms
19,712 KB
testcase_14 AC 1 ms
6,944 KB
testcase_15 AC 1 ms
6,944 KB
testcase_16 AC 1 ms
6,944 KB
testcase_17 AC 1 ms
6,940 KB
testcase_18 AC 140 ms
95,616 KB
testcase_19 AC 55 ms
35,072 KB
testcase_20 AC 47 ms
31,232 KB
testcase_21 AC 105 ms
71,936 KB
testcase_22 AC 117 ms
80,384 KB
testcase_23 AC 118 ms
80,512 KB
testcase_24 AC 3 ms
6,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
long long int fix(long long int n){
    while(n>1000000007){
		n=n%1000000007;
	}
	return n;
}

long long int led(long long int n){
    long long int ans;
    if(n==1){
        return 1;
    }
    else{
		ans=fix(n*(2*n-1))*led(n-1);
		while(ans>1000000007){
		    ans=ans%1000000007;
    	}
        return ans;
    }
    return 0;
}
int main(void){
    long long int n;
    scanf("%lld",&n);
    printf("%lld",led(n));
}
0