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
pythonimport sys from collections import defaultdict def main(): n, m = map(int, sys.stdin.readline().split()) adj = defaultdict(set) for _ in range(m): a, b = map(int, sys.stdin.readline().split()) adj[a].add(b) for a in adj: for b in adj[a]: for c in adj[b]: if a in adj[c]: print("YES") return print("NO") if __name__ == "__main__": main()
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.