結果
問題 | No.1749 ラムドスウイルスの感染拡大 |
ユーザー |
|
提出日時 | 2021-11-20 22:22:52 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 6 ms / 2,000 ms |
コード長 | 612 bytes |
コンパイル時間 | 5,311 ms |
コンパイル使用メモリ | 309,892 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-12 02:20:21 |
合計ジャッジ時間 | 6,406 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 26 |
ソースコード
#include <bits/stdc++.h> #if __has_include(<atcoder/all>) #include <atcoder/all> using namespace atcoder; #endif #define rep(i, n) for (int i = 0; i < (n); ++i) using std::cin; using std::cout; using std::vector; using mint = modint998244353; int main() { int n, m, t; cin >> n >> m >> t; vector<vector<int>> to(n); rep(i, m) { int s, t; cin >> s >> t; to[s].push_back(t); to[t].push_back(s); } vector<mint> dp(n); dp[0] = 1; rep(i, t) { vector<mint> p(n); swap(dp, p); rep(j, n) { for (int k : to[j]) { dp[j] += p[k]; } } } cout << dp[0].val() << '\n'; return 0; }