結果
問題 |
No.420 mod2漸化式
|
ユーザー |
|
提出日時 | 2018-06-14 23:59:21 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 580 bytes |
コンパイル時間 | 1,479 ms |
コンパイル使用メモリ | 166,916 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-06-30 14:37:36 |
合計ジャッジ時間 | 2,619 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 32 WA * 3 |
ソースコード
#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 = 1, ans2 = 1; cin >> x; if(x==0) { ans2 = 0; } else { 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; }