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 sys import stdin def main(): n, m = map(int, stdin.readline().split()) adj = dict() for _ in range(m): a, b = map(int, stdin.readline().split()) if a not in adj: adj[a] = set() adj[a].add(b) for u in adj: for v in adj[u]: if v in adj: for w in adj[v]: if w in adj and u in adj.get(w, set()): 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.