結果
| 問題 | No.3476 {2^n-1}-gon |
| コンテスト | |
| ユーザー |
ぽえ
|
| 提出日時 | 2026-03-19 17:23:27 |
| 言語 | C++23 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 10 ms / 2,000 ms |
| コード長 | 484 bytes |
| 記録 | |
| コンパイル時間 | 5,480 ms |
| コンパイル使用メモリ | 378,340 KB |
| 実行使用メモリ | 7,720 KB |
| 最終ジャッジ日時 | 2026-03-20 20:51:18 |
| 合計ジャッジ時間 | 6,216 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 18 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#include <atcoder/all>
using namespace atcoder;
using mint = modint998244353;
const long long mod = 998244353;
mint C(int n, int r) {
mint x = 1, y = 1;
for (int i=0; i<r; ++i) {
x *= n - i;
y *= i + 1;
}
return x / y;
}
int main() {
int n, m; cin >> n >> m;
mint u = C(pow_mod(2, n, mod)-1, m);
mint c = (pow_mod(2, n, mod)-1) * C(pow_mod(2, n-1, mod)-1, m-1);
cout << (u - c).val();
}
ぽえ