結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 1 ms
4,384 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 WA -
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 8 ms
10,904 KB
testcase_09 AC 8 ms
10,896 KB
testcase_10 AC 19 ms
18,692 KB
testcase_11 AC 18 ms
18,612 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,280 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 1 ms
4,380 KB
testcase_23 AC 1 ms
4,380 KB
testcase_24 WA -
testcase_25 AC 14 ms
15,972 KB
testcase_26 AC 10 ms
12,216 KB
testcase_27 AC 8 ms
11,284 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,t;
        cin >> s >> t;
        vv[s][t] = vv[t][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