結果
問題 |
No.420 mod2漸化式
|
ユーザー |
![]() |
提出日時 | 2023-12-12 14:33:31 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 516 bytes |
コンパイル時間 | 2,255 ms |
コンパイル使用メモリ | 193,616 KB |
最終ジャッジ日時 | 2025-02-18 10:29:23 |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 35 |
ソースコード
#include <bits/stdc++.h> #include<iostream> #include<iomanip> #include<string> #include<algorithm> #include<vector> #include<set> #include<list> #include<queue> #include<math.h> #include<bitset> using ll = long long; using namespace std; long long choose(int n, int r){ if (r>n || r < 0) return 0; ll s = 1; for (int i = 1; i <= r; i++) s = s*(n-i+1)/i; return s; } int main() { int x; cin >> x; cout << fixed << choose(31, x) << " " << choose(30, x-1)*(ll)((pow(2, 31) - 1)) << endl; }