結果

問題 No.420 mod2漸化式
ユーザー naipia
提出日時 2018-06-25 19:49:26
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 448 bytes
コンパイル時間 1,234 ms
コンパイル使用メモリ 160,124 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-06-30 22:40:58
合計ジャッジ時間 2,577 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 17 WA * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
#define ll long long

int main(){
    int x;
    cin >> x;
    if(x>31) cout << 0 << ' ' << 0 << endl;
    else if(x==0) cout << 1 << ' ' << 0 << endl;
    else{
        ll num=1,sum=1;
        for(int i=0;i<x-1;i++) sum*=(30-i);
        for(int i=0;i<x-1;i++) sum/=(x-1-i);
        num=sum*31/x;
        sum*=numeric_limits<int>::max();
        cout << num << ' ' << sum << endl;
    }
    return 0;
}
0