結果
問題 |
No.1749 ラムドスウイルスの感染拡大
|
ユーザー |
![]() |
提出日時 | 2025-08-28 00:03:30 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 5 ms / 2,000 ms |
コード長 | 650 bytes |
コンパイル時間 | 2,895 ms |
コンパイル使用メモリ | 283,024 KB |
実行使用メモリ | 7,716 KB |
最終ジャッジ日時 | 2025-08-28 00:03:35 |
合計ジャッジ時間 | 4,436 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 26 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); ++i) using ll = long long; using ull = unsigned long long; #include <atcoder/modint> using mint = atcoder::modint998244353; int main() { cin.tie(nullptr)->sync_with_stdio(false); int n, m, t; cin >> n >> m >> t; vector Graph(n, vector<int>()); rep(_, m) { int a, b; cin >> a >> b; Graph[a].push_back(b); Graph[b].push_back(a); } vector<mint> dp(n, 0); dp[0] = 1; rep(_, t) { vector<mint> ndp(n, 0); rep(i, n) for (int j : Graph[i]) ndp[j] += dp[i]; swap(dp, ndp); } cout << dp[0].val() << '\n'; return 0; }