結果
問題 |
No.420 mod2漸化式
|
ユーザー |
![]() |
提出日時 | 2017-03-10 16:33:12 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 516 bytes |
コンパイル時間 | 1,206 ms |
コンパイル使用メモリ | 159,340 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-24 07:52:43 |
合計ジャッジ時間 | 2,447 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 32 WA * 3 |
ソースコード
#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<<" "<<endl; return 0; } cout<<choose(31,X)<<" "<<choose(30,X-1)*2147483647<<endl; return 0; }