problem: CSES coin combinations I Link: https://cses.fi/problemset/task/1635 My code:
include<bits/stdc++.h>
using namespace std; int mod = 1000000007; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int n,x; cin >> n >> x; vector coins(n); for (int i = 0; i < n;i++) cin >> coins[i]; vector dp(x + 1, 0); dp[0] = 1; for (int i = 1; i <= x;i++){ for (auto j : coins){ if(i-j>=0) dp[i] = (dp[i] + dp[i — j])%mod; } } cout << dp[x]; return 0; }








As the bounds are quite large, try to avoid using vectors and use arrays instead.
Also, next time you should put your code in code blocks like this
or just link us to your submission
give ur code like this on codeforces blogs and comments