Path of exact cost k in DAG struggling with this question from an exam: 

input: 

&emsp;&emsp;DAG G=(V,E). each edge  $e_i$ has weight $w_i\in \text{{0,1,2,3}} $ 

&emsp;&emsp;Two vertices : s,t

&emsp;&emsp;Number: k

output: 

&emsp;&emsp;A path from s to t with total cost k (if exists)
When you get a question about a DAG, the first thing to do is a topological sort.

Now, go through all vertexes in order. For each vertex $v$, keep all the possible costs of a path from $s$ to $v$; there will be no more than $3V$ distinct costs. For each edge $e(v,u)$, add to $u$ the costs of $v$ + the weight of $e$.