mickeyandkaka's blog

By mickeyandkaka, history, 2 years ago, In English

Shopee Code League 2022 Qualification Round has just finished, but I'm stucked on a problem called "Connecting the Numbers".

Problem is simple, given 1~n with each number appear twice on a circle (2n numbers in the circle), we can connect the same number inside the circle or outside the circle. We need to check whether or not we can connect all the n pair of numbers without any cross.

2 <= n <= 1e5, 2*n numbers in the input and each number is within [1, n]

I think it's 2-sat, but wa on test3 and MLE on test 5. Do you have any other solutions?

  • Vote: I like it
  • +17
  • Vote: I do not like it

»
2 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by mickeyandkaka (previous revision, new revision, compare).

»
2 years ago, # |
  Vote: I like it +14 Vote: I do not like it

Hi, I just completed Shopee Code League as well, and there seems to be some discussion that the model answers they gave for "Connecting the Numbers" are wrong: https://www.hackerearth.com/challenges/competitive/shopee-code-league-2022-qualification-round/discussion/is-connecting-the-nu-354823c6/