pyetwi's blog

By pyetwi, history, 3 years ago, In English

Can anyone give a solution sketch for this problem? I've been stuck on it for a while and cannot find a solution online. Thanks!

https://open.kattis.com/problems/olympiadtraining

Full text and comments »

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

By pyetwi, history, 3 years ago, In English

Given a string a and b that consist of exactly the same characters, determine the minimum “cuts” required on string a such that it is possible to rearrange the segments of string a to match string b,

For instance, if a = “xxyyz” and b = “zxyxy”, the minimum cuts required on string a is 3

Illustration: x | xy | y | z --> z-xy-x-y

Constraints: |a| = |b| <= 20.

Time limit: 1 second

Full text and comments »

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