kgw2012   1년 전

ㅏㅗㅠㅓㅣㅏ;ㅜㅏ;ㅣㅡ';;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

yeonho12345   1년 전

#include<bits/stdc++.h>

using namespace std;

using ll = long long;

const ll mod = 998244353;

ll N, T;

ll modpow(ll a, ll b) {

ll ret = 1;

while(b) {

if(b&1) ret = ret * a % mod;

b >>= 1; a = a * a % mod;

}

return ret;

}

int main() {

cin.tie(nullptr); ios::sync_with_stdio(false);

cin >> N >> T;

++T; vector<ll> x(N);

for(ll &i:x) cin >> i;

ll ans = 1;

for(int i=N-1;i>=0;--i) {

T -= x[i]-1;

ans *= T;

ans %= mod;

}

ans *= T-N;

ans %= mod;

ans *= modpow(T,mod-2);

ans %= mod;

cout << ans << '\n';

return 0;

}

kangwoon   1년 전

답 알려주는 것은 곤란합니다.

댓글을 작성하려면 로그인해야 합니다.