結果
問題 |
No.420 mod2漸化式
|
ユーザー |
|
提出日時 | 2025-09-29 14:16:07 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 664 bytes |
コンパイル時間 | 2,942 ms |
コンパイル使用メモリ | 275,776 KB |
実行使用メモリ | 7,716 KB |
最終ジャッジ日時 | 2025-09-29 14:16:12 |
合計ジャッジ時間 | 4,642 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 35 |
ソースコード
// #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 = __int128(b) * ((1LL << 31) - 1) * x / 31; cout << b << ' ' << s << '\n'; }