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