結果

問題 No.420 mod2漸化式
ユーザー rabimea
提出日時 2025-09-29 14:14:00
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 654 bytes
コンパイル時間 2,856 ms
コンパイル使用メモリ 275,568 KB
実行使用メモリ 7,716 KB
最終ジャッジ日時 2025-09-29 14:14:04
合計ジャッジ時間 4,430 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 34 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

// #pragma GCC optimize ("Ofast")
// #pragma GCC optimize ("unroll-loops")
// #pragma GCC target ("avx,avx2,fma")
#include <bits/stdc++.h>

using std::cin, std::cout, std::cerr;
using ll = long long;

const int N = 32;
ll c[N][N];

int main() {
    std::ios::sync_with_stdio(false);
    int x; cin >> x;
    if(x > 31) {
        cout << 0 << ' ' << 0 << '\n';
        return 0;
    }

    c[0][0] = 1;
    for(int i = 1; i < N; i ++) {
        c[i][0] = 1;
        for(int j = 1; j <= i; j ++)
            c[i][j] = c[i - 1][j] + c[i - 1][j - 1];
    }

    ll b = c[31][x];
    ll s = b * ((1LL << 31) - 1) / 31 * x;
    cout << b << ' ' << s << '\n';
}
0