Wunka's blog

By Wunka, history, 3 years ago, In English

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

  • Vote: I like it
  • -5
  • Vote: I do not like it

| Write comment?
»
3 years ago, # |
  Vote: I like it 0 Vote: I do not like it

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