You have a directed graph with weighted edges (can be negative). Find the maximum-score path from 1 to n. If there is a positive cycle reachable from 1 that can reach n, the answer is infinite. Otherwise, use DP on the DAG formed by nodes reachable from 1.
Process in topological order, track dp[v] = max score to reach v. Detect positive cycles using a modified DFS that tracks nodes in the current recursion stack.