Comments

Hi! I'm no expert in DP, but these pages have typical DP problems to get started, ranging from easiest to most difficult.

Page 1 (at coder) Page 2 (cses)

Also, if it helps, I think of DP as a recursive function, asking myself what a DP state stores, for example: << f(i) gives me the maximum value I can get from position "i" >>

Also, it's worth noting that you can't see other people's code during a live contest, even in virtual ones. Try reviewing old submitted problems from the general problemset after LOGGING IN. Once the contest is over, the code is usually visible.

On u1804011MEX of an array, 3 years ago
0

Would this code, to make a function, be okay?

ll find_mex(vector<ll> a){
	set<ll> st;
	fore(i, 0, sz(a)+1){
		st.insert(i);
	}
	fore(i, 0, sz(a)){
		if(st.count(a[i])){
			st.erase(a[i]);
		}
	}
	auto it = st.begin();
	return *it;
}