UTPC_Admin's blog

By UTPC_Admin, history, 14 months ago, In English

Hope you enjoyed our contest! The editorial is below:

A — Fishy Tank

Author: DylanSmith
Idea: fishy15

Solution

B — Card Counting

Author: tn757

Solution

C — Balloon Fiesta

Author: DylanSmith

Solution

D — City Renewal

Author: GhOsT16790

Solution

E — Cable Plan

Author: mwen
Editorial: DylanSmith

Solution

F — Night Ride

Author: m7a1g5i8k8a1r4p0

Solution

G — Music Festival

Author: fishy15

Solution

H — Lineism

Author: RandyG

Solution

I — Game, Set, Match

Author: bubbarob19

Solution

J — Security Breach

Author: ChiMasterBing

Solution

K — Philadelphia Museum of Art

Author: zmonster8

Solution

L — Trapped in the Big Apple

Author: WalrusRamen21

Solution

M — Tea Party

Author: meize

Solution
  • Vote: I like it
  • +37
  • Vote: I do not like it

»
14 months ago, hide # |
 
Vote: I like it +8 Vote: I do not like it

For C, after processing with suffix automaton, you can maintain all adjacent differences of positions during small-to-large merging. There are $$$O(\sqrt n)$$$ different such values for each node, so this has complexity $$$O(n\cdot\sqrt n)$$$ while being very easy to code.