Google code jam: Problem B. Magicka

Reading time ~1 minute

題目

一直在想說為啥我submit的答案有問題想到沒睡好, 剛剛才發現, 我誤會了一個關鍵句:

it is opposed to something in your element list, then your whole element list will be cleared.

結果我誤解成只有被兩個字元夾住的區域才會clear, test set也沒驗出我的問題…. = =“

這題關鍵除了這個外, 還有

If the two elements from a pair appear at the end of the element list, then both elements of the pair will be immediately removed, and they will be replaced by the element they form.

所以, ”1 QFT 1 QF 7 FAQFDFQ"的答案會是"[F, D, T]“而不是”[]“

浪費了一題… :(