結果
問題 | No.420 mod2漸化式 |
ユーザー |
![]() |
提出日時 | 2017-08-03 22:56:17 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 366 bytes |
コンパイル時間 | 417 ms |
コンパイル使用メモリ | 55,416 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-11 20:35:14 |
合計ジャッジ時間 | 1,467 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 35 |
ソースコード
#include <iostream>using namespace std;int main(){long long int x;long long int ans=1,sum=1;cin >> x;if(x>31)ans=0;else{for(long long int i=1;i<=x;i++)ans=ans*(31-i+1)/i;}if(x==0 || x>31)sum=0;else{for(long long int i=i=1;i<=x-1;i++)sum=sum*(30-i+1)/i;sum*=2147483647;}cout << ans << " " << sum << endl;return 0;}