Programare+dinamica


 * Programare dinamică :** [[file:dinamic.pdf]]


 * 1. Cel mai lung subşir crescător: [[file:Subsir crescator maximal.pdf]]**
 * 2. Suma maximă în triunghi: [[file:Suma in triunghi.pdf]]**
 * 3. Submatrice pătratică maximală: [[file:Submatrice patratica maximala.pdf]]**
 * 4. Problema rucsacului (programare dinamică): [[file:Problema rucsacului.pdf]]**


 * Aplicaţii programare dinamica**


 * Probleme rezolvate - programare dinamica**


 * Probleme rezolvate de *Kisari Andrei *Ianchis Flaviu**
 * 1. Cel mai lung subsir crescator [[file:subsir.cpp]]**
 * 2. Triunghi de numere [[file:triunghi.cpp]]**


 * Probleme din arhiva educationala infoarena:**
 * 1. Subsir crescator maximal Scmax**
 * 2. Cel mai lung subsir comun Cmlsc**
 * 3. Subsecventa de suma maxima Ssm **


 * Probleme programare dinamica varena **
 * 1. Dreptunghiuri subsir crescator maximal **
 * 2. Bani - USACO**
 * 3. Semisume - USACO**
 * 4. Petrol**
 * 5. Rucsac**
 * 6. Trick or treat**


 * __Programare dinamica pbinfo__**


 * Probleme din arhiva campion : programare dinamica**
 * 1. ArbSum**
 * 2. Treegame**
 * 3. Tree**


 * Codeforces DP Problems**

__Dynamic Programming (DP) : __
 * Good DP problems**

a. [|LCS]  Problem: 1. [|SAMER08D]
 * 1. Classic Dynamic Programming **

b. [|LIS]  Problem: 1. [|Beautiful People]  2. [|MDOLLS]  3. [|MSTICK]  4. [|MCARDS]

<span style="color: #222222; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px;">c. <span style="color: #4d87c7; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; text-decoration: none;">[|Edit Distance]

<span style="color: #222222; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px;">d. <span style="color: #4d87c7; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; text-decoration: none;">[|Matrix Chain Multiplication] <span style="color: #222222; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px;"> Problem: 1. <span style="color: #4d87c7; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; text-decoration: none;">[|Mixtures]

<span style="color: #222222; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px;">e. <span style="color: #4d87c7; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; text-decoration: none;">[|Knapsack] <span style="color: #222222; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px;"> Problem: 1. <span style="color: #4d87c7; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; text-decoration: none;">[|Scubadiv]

<span style="color: #222222; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px;">a. DP k-th lexicographical string Problem: 1. [|z-01 paths] <span style="color: #222222; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px;"> 2. <span style="color: #4d87c7; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; text-decoration: none;">[|z-board] <span style="color: #222222; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px;"> 3. <span style="color: #4d87c7; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; text-decoration: none;">[|Linear Garden (IOI 2008)]
 * <span style="color: #222222; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px;">2. Advance DP **

<span style="color: #222222; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px;">b. DP tree <span style="color: #222222; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px;"> Problem: 1. <span style="color: #4d87c7; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; text-decoration: none;">[|z-sumpaths] <span style="color: #222222; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px;"> 2. <span style="color: #4d87c7; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; text-decoration: none;">[|River (IOI 2005)] <span style="color: #222222; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px;"> 3. <span style="color: #4d87c7; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; text-decoration: none;">[|z-company] <span style="color: #222222; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px;"> 4. <span style="color: #4d87c7; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; text-decoration: none;">[|Greedy Hydra (CNOI 2002)] <span style="color: #222222; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px;"> 5. <span style="color: #4d87c7; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; text-decoration: none;">[|__VOCV__] 6. [|PT07F] 7. [|PT07X] <span style="color: #222222; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px;"> 8. <span style="color: #4d87c7; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; text-decoration: none;">[|nagibni]

<span style="color: #222222; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px;">c. DP+ BIT/segment tree <span style="color: #222222; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px;"> Problem: 1. <span style="color: #4d87c7; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; text-decoration: none;">[|Salesman (IOI 2009)] <span style="color: #222222; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px;"> 2. <span style="color: #4d87c7; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; text-decoration: none;">[|explosion] <span style="color: #222222; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px;"> 3. <span style="color: #4d87c7; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; text-decoration: none;">[|intervali] <span style="color: #222222; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px;"> 4. <span style="color: #4d87c7; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; text-decoration: none;">[|RENT] <span style="color: #222222; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px;"> 5. <span style="color: #4d87c7; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; text-decoration: none;">[|INCSEQ] <span style="color: #222222; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px;"> 6. <span style="color: #4d87c7; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; text-decoration: none;">[|INCDSEQ]

<span style="color: #222222; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px;">d. DP+ convex hull <span style="color: #222222; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px;"> Problem: 1. <span style="color: #4d87c7; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; text-decoration: none;">[|Batch Scheduling (IOI 2002)] <span style="color: #222222; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px;"> 2. <span style="color: #4d87c7; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; text-decoration: none;">[|NKLEAVES] <span style="color: #222222; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px;"> 3. <span style="color: #4d87c7; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; text-decoration: none;">[|Harbingers (CEOI 2009)] <span style="color: #222222; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px;"> 4. <span style="color: #4d87c7; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; text-decoration: none;">[|Commando (APIO 2010)]

<span style="color: #222222; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px;">e. DP pre-processing <span style="color: #222222; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px;"> Problem: 1. <span style="color: #4d87c7; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; text-decoration: none;">[|Oil (APIO 2009)] <span style="color: #222222; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px;"> 2. <span style="color: #4d87c7; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; text-decoration: none;">[|Garden (IOI 2005)] <span style="color: #222222; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px;"> 3. <span style="color: #4d87c7; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; text-decoration: none;">[|Pyramid (IOI 2006)]

<span style="color: #222222; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px;">f. DP bitmask <span style="color: #222222; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px;"> Problem: 1. <span style="color: #4d87c7; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; text-decoration: none;">[|Reklame] <span style="color: #222222; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px;"> 2. <span style="color: #4d87c7; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; text-decoration: none;">[|Chess] <span style="color: #222222; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px;"> 3. <span style="color: #4d87c7; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; text-decoration: none;">[|Bond] <span style="color: #222222; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px;"> 4. <span style="color: #4d87c7; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; text-decoration: none;">[|TRSTAGE] <span style="color: #222222; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px;"> 5. <span style="color: #4d87c7; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; text-decoration: none;">[|HIST2] <span style="color: #222222; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px;"> 6. <span style="color: #4d87c7; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; text-decoration: none;">[|LAZYCOWS]

<span style="color: #222222; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px;">g. Problem 1: <span style="color: #4d87c7; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; text-decoration: none;">[|Grid (BOI 2008)]

<span style="color: #222222; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px;">h. DP matrix multiplication/ DP using recurrence <span style="color: #222222; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px;"> Problem 1. <span style="color: #4d87c7; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; text-decoration: none;">[|SEQ] <span style="color: #222222; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px;"> 2. <span style="color: #4d87c7; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; text-decoration: none;">[|SPP] <span style="color: #222222; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px;"> 3. <span style="color: #4d87c7; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; text-decoration: none;">[|z-funkcija] <span style="color: #222222; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px;"> 4. <span style="color: #4d87c7; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; text-decoration: none;">[|mit-indiv09-words] <span style="color: #222222; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px;"> 5. <span style="color: #4d87c7; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; text-decoration: none;">[|Reading (Balkan 2009)] <span style="color: #222222; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px;"> 6. <span style="color: #4d87c7; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; text-decoration: none;">[|Super Climber] <span style="color: #222222; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px;"> 7. <span style="color: #4d87c7; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; text-decoration: none;">[|z-mario]

<span style="color: #222222; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px;">i. DP+ trie <span style="color: #222222; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px;"> Problem 1. <span style="color: #4d87c7; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; text-decoration: none;">[|MORSE]

<span style="color: #222222; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px;">j. DP+geometry <span style="color: #222222; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px;"> Problem 1. <span style="color: #4d87c7; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; text-decoration: none;">[|MPOLY] <span style="color: #222222; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px;"> 2. <span style="color: #4d87c7; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; text-decoration: none;">[|CVXPOLY] <span style="color: #222222; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px;"> 3. <span style="color: #4d87c7; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; text-decoration: none;">[|MTRIAREA]

<span style="color: #222222; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px;">k. DP + Binary Search Problem 1. Game (IOI 2008, Practice session) <span style="color: #222222; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px;">l. DP + Knuth Optimization <span style="color: #222222; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px;"> Problem 1. <span style="color: #4d87c7; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; text-decoration: none;">[|Breaking Strings] <span style="color: #222222; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px;">Other Problems in SPOJ can be found <span style="color: #4d87c7; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; text-decoration: none;">[|here] <span style="color: #222222; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px;"> by <span style="color: #4d87c7; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; text-decoration: none;">[|pt1989] <span style="color: #222222; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px;">Thanks to <span style="color: #4d87c7; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; text-decoration: none;">[|pt1989]

<span style="color: #222222; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px;">Here are problems in <span style="color: #4d87c7; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; text-decoration: none;">[|acm.sgu.ru] [|269] <span style="color: #222222; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px;">, <span style="color: #4d87c7; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; text-decoration: none;">[|273] <span style="color: #222222; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px;">, <span style="color: #4d87c7; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; text-decoration: none;">[|304] <span style="color: #222222; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px;">, <span style="color: #4d87c7; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; text-decoration: none;">[|317] <span style="color: #222222; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px;">, <span style="color: #4d87c7; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; text-decoration: none;">[|356] <span style="color: #222222; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px;">, <span style="color: #4d87c7; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; text-decoration: none;">[|396] <span style="color: #222222; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px;">, <span style="color: #4d87c7; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; text-decoration: none;">[|445] <span style="color: #222222; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px;">, <span style="color: #4d87c7; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; text-decoration: none;">[|447] <span style="color: #222222; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px;">, <span style="color: #4d87c7; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; text-decoration: none;">[|458] <span style="color: #222222; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px;">, <span style="color: #4d87c7; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; text-decoration: none;">[|489] <span style="color: #222222; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px;">, <span style="color: #4d87c7; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; text-decoration: none;">[|494] <span style="color: #222222; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px;">Thanks to <span style="color: #4d87c7; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; text-decoration: none;">[|natalia]

<span style="color: #222222; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px;">Reference: <span style="color: #222222; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px;"> 1. <span style="color: #4d87c7; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; text-decoration: none;">[|Topcoder] <span style="color: #222222; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px;"> 2. <span style="color: #4d87c7; font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; font-size: 14px; text-decoration: none;">[|Codechef]