結果

問題 No.420 mod2漸化式
ユーザー rapurasu
提出日時 2017-03-10 16:33:48
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 519 bytes
コンパイル時間 1,238 ms
コンパイル使用メモリ 158,844 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-24 07:52:45
合計ジャッジ時間 2,196 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 35
権限があれば一括ダウンロードができます

ソースコード

diff #

 #include<bits/stdc++.h>
 using namespace std;
#define INF 1000000000
#define REP(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
typedef long long LL;
LL X;

LL choose(LL a,LL x){
   LL ans=1;
   REP(i,x){
       ans*=(a-i);
       ans/=(i+1);
      // cout<<ans<<endl;
   }
   return ans;
}
int main(){
    cin>>X;
    if(X==0){
       cout<<1<<" "<<0<<endl;
       return 0;
    }
    if(X>31){
       cout<<0<<" "<<0<<endl;
       return 0;
    }
    cout<<choose(31,X)<<" "<<choose(30,X-1)*2147483647<<endl;
    return 0;
}
0