#include #include #include using namespace std; using ll = long long; #include #include using mint = atcoder::modint998244353; int main(){ cin.tie(nullptr); ios::sync_with_stdio(false); int n; cin>>n; vector a(n); int cnt = 0; for(int i = 0;i>a[i]; if(a[i]!=-1) a[i]--; if(a[i]==-1) cnt++; } vector fac(n+1,1),ifac(n+1,1); for(int i = 1;i<=n;i++) fac[i] = fac[i-1] * i; for(int i = 1;i<=n;i++) ifac[i] = fac[i].inv(); mint ans = 0; auto comb = [&](int n,int r) -> mint { if(n b; vector use(n,0); for(int i = 0;i use(n,0); for(int i = 0;i sum(n+1,0); for(int i = 0;i