This shows you the differences between two versions of the page.
|
pa:laboratoare:laborator-08 [2026/04/25 10:54] radu.nichita [5) Swim in Rising Water] |
pa:laboratoare:laborator-08 [2026/05/11 02:04] (current) radu.nichita [Implementarea algoritmilor standard] |
||
|---|---|---|---|
| Line 447: | Line 447: | ||
| * Dacă avem mai multe surse / destinații, putem rula pentru fiecare sursă Dijkstra /Bellman-Ford, obținând complexitate $O(n * m * log n)$ / $O(n^2 * m)$. Vom vedea în laboratorul următor cum putem îmbunătăți acest lucru. | * Dacă avem mai multe surse / destinații, putem rula pentru fiecare sursă Dijkstra /Bellman-Ford, obținând complexitate $O(n * m * log n)$ / $O(n^2 * m)$. Vom vedea în laboratorul următor cum putem îmbunătăți acest lucru. | ||
| - | ===== Exerciții ===== | + | ===== Implementarea algoritmilor standard ===== |
| <note> | <note> | ||
| + | [[https://github.com/acs-pa/pa-lab/tree/main/algorithms/lab08|pa-lab/algorithms/lab08]] conține implementarea algoritmilor standard / tehnicilor / tiparelor de algoritmi pentru acest laborator. | ||
| + | </note> | ||
| - | Scheletul de laborator se găsește pe pagina [[https://github.com/acs-pa/pa-lab/tree/main/skel/lab09|pa-lab::skel/lab09]]. | ||
| - | </note> | ||
| <note warning> | <note warning> | ||
| Line 552: | Line 551: | ||
| </note> | </note> | ||
| - | ====== Pool probleme (Drumuri minime și aplicații) ====== | + | ====== Pool probleme (pentru prezentări) ====== |
| ======= 1) Cheapest Flights Within K Stops ======= | ======= 1) Cheapest Flights Within K Stops ======= | ||
| Line 562: | Line 561: | ||
| Date de ieșire: Un singur număr întreg reprezentând costul minim al drumului. Dacă nu există niciun traseu valid care să respecte condiția numărului de escale, se va returna -1. | Date de ieșire: Un singur număr întreg reprezentând costul minim al drumului. Dacă nu există niciun traseu valid care să respecte condiția numărului de escale, se va returna -1. | ||
| - | Problema se poate testa la: \ | + | Problema se poate testa la: |
| [[https://leetcode.com/problems/cheapest-flights-within-k-stops/ | LeetCode - Cheapest Flights Within K Stops]] | [[https://leetcode.com/problems/cheapest-flights-within-k-stops/ | LeetCode - Cheapest Flights Within K Stops]] | ||
| Line 573: | Line 572: | ||
| Date de ieșire: Timpul minim după care toate nodurile sunt atinse. Dacă este imposibil ca semnalul să ajungă la toate cele ''n'' noduri, se va afișa -1. | Date de ieșire: Timpul minim după care toate nodurile sunt atinse. Dacă este imposibil ca semnalul să ajungă la toate cele ''n'' noduri, se va afișa -1. | ||
| - | Problema se poate testa la: \ | + | Problema se poate testa la: |
| [[https://leetcode.com/problems/network-delay-time/ | LeetCode - Network Delay Time]] | [[https://leetcode.com/problems/network-delay-time/ | LeetCode - Network Delay Time]] | ||
| Line 584: | Line 583: | ||
| Date de ieșire: Scorul maxim posibil. Dacă se poate obține un scor infinit de mare (există un ciclu de scor pozitiv pe un drum care conectează nodul 1 de nodul ''n''), se va afișa -1. | Date de ieșire: Scorul maxim posibil. Dacă se poate obține un scor infinit de mare (există un ciclu de scor pozitiv pe un drum care conectează nodul 1 de nodul ''n''), se va afișa -1. | ||
| - | Problema se poate testa la: \ | + | Problema se poate testa la: |
| [[https://cses.fi/problemset/task/1673 | CSES - High Score]] | [[https://cses.fi/problemset/task/1673 | CSES - High Score]] | ||
| Line 595: | Line 594: | ||
| Date de ieșire: Un singur număr întreg reprezentând costul minim de la orașul 1 la orașul ''n''. | Date de ieșire: Un singur număr întreg reprezentând costul minim de la orașul 1 la orașul ''n''. | ||
| - | Problema se poate testa la: \ | + | Problema se poate testa la: |
| [[https://cses.fi/problemset/task/1195 | CSES - Flight Discount]] | [[https://cses.fi/problemset/task/1195 | CSES - Flight Discount]] | ||