結果
問題 |
No.420 mod2漸化式
|
ユーザー |
|
提出日時 | 2018-06-15 00:01:25 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 658 bytes |
コンパイル時間 | 1,526 ms |
コンパイル使用メモリ | 166,648 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-30 14:37:39 |
合計ジャッジ時間 | 2,556 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 35 |
ソースコード
#include "bits/stdc++.h" using namespace std; #define fastcin {\ cin.tie(0);\ ios::sync_with_stdio(false);\ } #define rrep(i, a, b) for(int i = a; i > b; i--) typedef long long ll; int main() { fastcin; int x; ll ans1, ans2; cin >> x; if(x==0) { ans1 = 1; ans2 = 0; } else if(x>31) { ans1 = ans2 = 0; } else { ans1 = ans2 = 1; rrep(i, 31, max(x, 31-x)) { ans1 = ans1*i / (32-i); } rrep(i, 30, max(x-1, 30-x+1)) { ans2 = ans2*i / (31-i); } ans2 = ans2 * 2147483647; } printf("%lld %lld\n", ans1, ans2); return 0; }