結果

問題 No.1749 ラムドスウイルスの感染拡大
ユーザー aoringo0606aoringo0606
提出日時 2021-11-19 22:52:25
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,784 bytes
コンパイル時間 1,676 ms
コンパイル使用メモリ 170,296 KB
実行使用メモリ 18,728 KB
最終ジャッジ日時 2023-08-30 09:49:05
合計ジャッジ時間 3,728 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 WA -
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 8 ms
10,936 KB
testcase_09 AC 8 ms
10,920 KB
testcase_10 AC 19 ms
18,612 KB
testcase_11 AC 19 ms
18,728 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 14 ms
14,056 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 1 ms
4,380 KB
testcase_23 AC 2 ms
4,384 KB
testcase_24 WA -
testcase_25 AC 14 ms
15,980 KB
testcase_26 AC 10 ms
12,240 KB
testcase_27 AC 9 ms
11,252 KB
testcase_28 WA -
testcase_29 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include "bits/stdc++.h"

#pragma warning(disable : 4996)

typedef long long ll;
#define all(x) (x).begin(), (x).end() // sortなどの引数を省略
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define max3(x, y, z) max(x, max(y, z))
#define min3(x, y, z) min(x, min(y, z))

#ifdef _MSC_FULL_VER //デバッグ出力
#define dout cout
#define debug() if (true)
#define check(x) std::cout << "★" << #x << "の値:" << (x) << endl
#define pass(x) std::cout << "☆" << x << endl
#else
#define dout   \
    if (false) \
    cout
#define debug() if (false)
#define check(x) \
    if (false)   \
    cout << "★" << #x << "の値:" << (x) << endl
#define pass(x) \
    if (false)  \
    cout << "☆" << x << endl
#endif

using namespace std;
//#define int long long;

double dist(double x1, double y1, double x2, double y2)
{
    return sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
}
ll idist(ll x1, ll y1, ll x2, ll y2)
{
    return (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);
}

signed main()
{
    ll n,m,t;
    cin >> n >> m >> t;
    vector<vector<ll>> v(n,vector<ll>(t+1));
    v[0][0] = 1;
    vector<vector<ll>> vv(n,vector<ll>(n));
    rep(i,m){
        ll s,ss;
        cin >> s >> ss;
        vv[s][ss] = vv[ss][s] = 1;
    }
    for(int d = 1;d <= t;d++){
        rep(i,n){
            if(v[i][d-1] > 0){
                rep(j,n){
                    if(vv[i][j] == 1){
                        v[j][d] += v[i][d-1];
                    }
                }
            }
        }
    }
    cout << v[0][t] % 998244353 << endl;
    /*rep(i,n){
        rep(j,t+1){
            cout << v[i][j] << " ";
        }
        cout << endl;
    }
    rep(i,n){
        rep(j,n){
            cout << vv[j][i];
        }
        cout << endl;
    }*/
    return 0;
}
0