{"task": {"agent_timeout": 600, "task": "225", "verifier_timeout": 7200, "instruction": "Please implement a Python 3 solution to the below problem.\nReason through the problem and:\n1. Restate the problem in plain English\n2. Conceptualize a solution first in plain English\n3. Write a pseudocode solution\n4. Save your solution as solution.py\nNo outside libraries are allowed.\n\n[BEGIN PROBLEM]\nProblem 3: Liars and Truth Tellers [Brian Dean, 2013]\n\nAfter spending so much time around his cows, Farmer John has started to\nunderstand their language.  Moreover, he notices that among his N cows \n(2 <= N <= 1000), some always tell the truth while others always lie.\n\nFJ carefully listens to M statements (1 <= M <= 10,000) from his cows, each\nof the form \"x y T\", meaning that \"cow x claims cow y always tells the\ntruth\" or \"x y L\", meaning that \"cow x claims cow y always tells lies\". \nEach statement involves a pair of different cows, and the same pair of cows\nmay appear in multiple statements.  \n\nUnfortunately, FJ believes he might have written down some entries in his\nlist incorrectly, so there may not be a valid way to designate each cow as\na truth teller or a liar that is consistent with all the M statements on\nFJ's list.  To help FJ salvage as much of his list as possible, please\ncompute the largest value of A such that there exists a valid way to\ndesignate each cow as a truth teller or a liar in a manner that is\nconsistent with the first A entries in FJ's list.\n\nPROBLEM NAME: truth\n\nINPUT FORMAT:\n\n* Line 1: Two space-separated integers, N and M.\n\n* Lines 2..1+M: Each line is of the form \"x y L\" or \"x y T\",\n        describing a statement made by cow x about cow y.\n\nSAMPLE INPUT:\n\n4 3\n1 4 L\n2 3 T\n4 1 T\n\nINPUT DETAILS:\n\nThere are 4 cows and 3 statements.  Cow 1 says that cow 4 lies, cow 2 says\nthat cow 3 tells the truth, and cow 4 says that cow 1 tells the truth.\n\nOUTPUT FORMAT:\n\n* Line 1: The maximum value of A such that the first A entries in FJ's\n        list can be consistent with some assignment of \"truth teller\"\n        or \"liar\" to the N cows.\n\nSAMPLE OUTPUT:\n\n2\n\nOUTPUT DETAILS:\n\nStatements 1 and 3 cannot both be satisfied at the same time, but\nstatements 1 and 2 can be, if we let cows 1..3 tell the truth and cow 4 be\na liar.\n\n[END PROBLEM]\n", "memory": "2048m", "runnable": false, "difficulty": "medium", "language": "", "cpus": 1, "instruction_truncated": false, "category": "python_programming", "compose": false, "has_solution": true, "oracle": null, "docker_image": "", "taskset": "usaco", "tags": ["python", "programming", "usaco"]}, "runs": []}