結果

問題 No.1327 グラフの数え上げ
ユーザー testestesttestestest
提出日時 2020-08-14 20:00:46
言語 C
(gcc 12.3.0)
結果
TLE  
実行時間 -
コード長 336 bytes
コンパイル時間 922 ms
コンパイル使用メモリ 30,720 KB
実行使用メモリ 13,756 KB
最終ジャッジ日時 2024-04-19 21:04:37
合計ジャッジ時間 4,263 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 0 ms
13,756 KB
testcase_01 TLE -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<stdio.h>
#include<string.h>
int main(){
    
    char s[20];
    scanf("%15s",s);
    if(strlen(s)>13)return 0&puts("0");

    const int MOD=1e9+7;
    long long n;
    sscanf(s,"%lld",&n);
    if(n>MOD)return 0&puts("0");
    
    long long ans=1;
    for(int i=1;i<n;i++)ans=ans*i%MOD;
    printf("%lld\n",n%2?ans:MOD-ans);
}
0