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()) in_degree = {i: 0 for i in range(1, n+1)} out_degree = {i: 0 for i in range(1, n+1)} for _ in range(m): a, b = map(int, input().split()) out_degree[a] += 1 in_degree[b] += 1 isolated = 0 for node in range(1, n+1): if in_degree[node] == 0 and out_degree[node] == 0: isolated += 1 if isolated == n and n > 3: print("NO") else: print("YES")
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.