This commit is contained in:
67
README.md
67
README.md
@@ -12,24 +12,24 @@ Voici mes réponses pour l'examen 2025 d'_Algorithmes et Structures de données_
|
||||
<table>
|
||||
<tr>
|
||||
<td><strong>But</strong></td>
|
||||
<td>...</td>
|
||||
<td>Compter le nombre de valeurs positives différentes ayant leur opposé dans une liste</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>Input</strong></td>
|
||||
<td>...</td>
|
||||
<td>La liste des demi-touches (entiers relatifs non-nuls)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>Output</strong></td>
|
||||
<td>...</td>
|
||||
<td>Le nombre de touches distinctes dont les valeurs positives et négatives sont dans la liste</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>Signature</strong></td>
|
||||
<td>
|
||||
|
||||
```python
|
||||
def function1(
|
||||
*args
|
||||
) -> Any:
|
||||
def countKey(
|
||||
pieces: list[int]
|
||||
) -> int:
|
||||
```
|
||||
|
||||
</td>
|
||||
@@ -46,24 +46,26 @@ def function1(
|
||||
<table>
|
||||
<tr>
|
||||
<td><strong>But</strong></td>
|
||||
<td>...</td>
|
||||
<td>Trouver le chemin le plus court entre deux points, en considérant que certaines routes ne sont praticables que de nuit/jour</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>Input</strong></td>
|
||||
<td>...</td>
|
||||
<td>Nœud de départ (index), nœud d'arrivée (index) et liste des routes / arêtes (nœud 1, nœud 2, restriction)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>Output</strong></td>
|
||||
<td>...</td>
|
||||
<td>Liste des nœuds (index) à parcourir</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>Signature</strong></td>
|
||||
<td>
|
||||
|
||||
```python
|
||||
def function2(
|
||||
*args
|
||||
) -> Any:
|
||||
def findSafestPath(
|
||||
start: int,
|
||||
end: int,
|
||||
intersections: list[tuple[int, int, int]]
|
||||
) -> list[int]:
|
||||
```
|
||||
|
||||
</td>
|
||||
@@ -80,24 +82,25 @@ def function2(
|
||||
<table>
|
||||
<tr>
|
||||
<td><strong>But</strong></td>
|
||||
<td>...</td>
|
||||
<td>Trouver dans un réseau de console un sous-graphe connexe de taille donnée</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>Input</strong></td>
|
||||
<td>...</td>
|
||||
<td>Taille n du sous-graphe recherché, liste des connexions</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>Output</strong></td>
|
||||
<td>...</td>
|
||||
<td>Liste de n consoles toutes interconnectées</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>Signature</strong></td>
|
||||
<td>
|
||||
|
||||
```python
|
||||
def function3(
|
||||
*args
|
||||
) -> Any:
|
||||
def findTightlyLinkedConsoles(
|
||||
n: int,
|
||||
consoles: list[tuple[int, int]]
|
||||
) -> list[int]:
|
||||
```
|
||||
|
||||
</td>
|
||||
@@ -114,24 +117,26 @@ def function3(
|
||||
<table>
|
||||
<tr>
|
||||
<td><strong>But</strong></td>
|
||||
<td>...</td>
|
||||
<td>Compter le nombre de séquences de N coups infligeant un total de H dégâts</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>Input</strong></td>
|
||||
<td>...</td>
|
||||
<td>Nombre N de coups dans la séquence, nombre C de coups possibles (dégâts 1 à C inclus), total H de dégâts</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>Output</strong></td>
|
||||
<td>...</td>
|
||||
<td>Nombre de séquences possibles</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>Signature</strong></td>
|
||||
<td>
|
||||
|
||||
```python
|
||||
def function4(
|
||||
*args
|
||||
) -> Any:
|
||||
def computeNbrOfDifferentSequences(
|
||||
N: int,
|
||||
C: int,
|
||||
H: int
|
||||
) -> int:
|
||||
```
|
||||
|
||||
</td>
|
||||
@@ -148,24 +153,26 @@ def function4(
|
||||
<table>
|
||||
<tr>
|
||||
<td><strong>But</strong></td>
|
||||
<td>...</td>
|
||||
<td>Trouver les placements de pièces Minitris formant un rectangle plein</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>Input</strong></td>
|
||||
<td>...</td>
|
||||
<td>Largeur de la grille, longueur de la grille, liste des pièces à poser</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>Output</strong></td>
|
||||
<td>...</td>
|
||||
<td>Liste des positions des pièces</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>Signature</strong></td>
|
||||
<td>
|
||||
|
||||
```python
|
||||
def function5(
|
||||
*args
|
||||
) -> Any:
|
||||
def playMinitrisFastAndWell(
|
||||
board_width: int,
|
||||
board_height: int,
|
||||
pieces: list[tuple[tuple[int,int], tuple[int,int]]]
|
||||
) -> list[list[int, int]]:
|
||||
```
|
||||
|
||||
</td>
|
||||
|
||||
Reference in New Issue
Block a user