Hi! I was solving problem C from Atcoder educational DP contest and it seems to me that this problem can be solved using bitmasks. If you're smarter than me and can solve this using bitmasks — share the solution in the comments(or if it is impossible to solve it in that way , explain please why it is impossible).
Link to the problem : https://atcoder.jp/contests/dp/tasks/dp_c
You dont really need bitmasks because the state of the dp is the index and the last activity, so you could technically make something like 100 if it is activity a, 010 if its activity b and 001 if its activity c, but you could just use 1 2 and 3