标签:signed cout highlight mes end clu for while names
#include<bits/stdc++.h> #define _for(i,a,b) for(int i=a;i<b;i++) #define _rep(i,a,b) for(int i=a;i<=b;i++) using namespace std; const int maxn = 100000; int m, l, r, Q = 998244353; unsigned long long A[maxn], k[maxn]; void solve() { memset(A, 0, sizeof(A)); A[0] = 1; for(int i = 1; i <= r; i++){ for(int j = i - 1; j >= i - min(m, i); j--){ A[i] += k[i-j-1]*A[j] % Q; } A[i] %= Q; if(i >= l) cout << A[i] << endl; } } int main() { while(cin >> m >> l >> r && m){ _for(i,0,m) cin >> k[i]; solve(); } return 0; }
标签:signed cout highlight mes end clu for while names
原文地址:https://www.cnblogs.com/sanshi-2018/p/10495894.html