UVa 10192

From Algorithmist
Revision as of 13:02, 11 January 2008 by LarryBot (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Contents

[edit] 10192 - Vacation

[edit] Summary

This might at first seems like a Graph Theory problem, but it is actually a simple Longest Common Subsequence (Dynamic Programming) problem.

[edit] Explanation

This is a simple Longest Common Subsequence (Dynamic Programming) problem, since this is the trip that would preserve the longest order of either recommendation.

[edit] Input

abcd
acdb
abcd
dacb
#

[edit] Output

Case #1: you can visit at most 3 cities.
Case #2: you can visit at most 2 cities.
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox