This issue is the same configuration issue as G: DAG Trio (Hard), with only the…
- User
This issue is the same configuration issue as G: DAG Trio (Hard), with only the constraints being different. input
Assistant
pythonn, m = map(int, input().split()) adj = [set() for _ in range(n+1)] edges = [] for _ in range(m): a, b = map(int, input().split()) edges.append((a, b)) adj[a].add(b) for a, b in edges: for c in adj[b]: if a in adj[c]: print("YES") exit() print("NO")
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.