{"abstract":"Duplicate registrations push a period over capacity.","category":"Exam timetabling constraints","checks":8,"contract":"sits [student, exam, period, access]; cap period -> seats (missing = 0); mode exam -> paper/online (missing = paper). Each distinct (student, exam) uses one seat, two with an access arrangement, and none for online exams. Return [period, used, capacity] for periods over capacity, by period.","evaluation_group":"w2-exam-timetabling-constraints-period-seat-capacity","failed_approach":"Deduplicating by student and period drops a clashing second exam's seat.","family":"w2-exam-timetabling-constraints-period-seat-capacity-duplicate-sitting-rows","id":"FA-94706","implementations":{"attempt":{"sha256":"a47914631c172b4662c97fcaa0b470559c47cc018320a4677278aa81b8a2855f","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(sits, cap, mode):\n    seen = set()\n    used = {}\n    for st, ex, p, acc in sits:\n        if (st, p) in seen:\n            continue\n        seen.add((st, p))\n        if mode.get(ex) == 'online':\n            continue\n        used[p] = used.get(p, 0) + (2 if acc else 1)\n    return [[p, used[p], cap.get(p, 0)] for p in sorted(used) if used[p] > cap.get(p, 0)]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression: duplicate sitting rows 1',\n   [[['s1', 'A', 0, False], ['s1', 'A', 0, False]], {0: 1}, {'A': 'paper'}], []),\n  ('regression variant: duplicate sitting rows 2',\n   [[['s2', 'PHYS110', 0, False], ['s1', 'BIO130', 2, True], ['s1', 'BIO130', 2, True]], {0: 4, 1: 3, 2: 3},\n    {'MATH101': 'online', 'PHYS110': 'paper', 'BIO130': 'paper'}],\n   []),\n  ('partial repair guard 3',\n   [[['s5', 'BIO130', 1, False], ['s3', 'BIO130', 1, False], ['s5', 'PHYS110', 1, False],\n     ['s3', 'BIO130', 2, False], ['s4', 'BIO130', 2, False]],\n    {0: 3, 1: 1, 2: 2}, {'MATH101H': 'paper', 'PHYS110': 'paper', 'CHEM120': 'online'}],\n   [[1, 3, 1]]),\n  ('boundary control 4', [[['s1', 'A', 0, False], ['s1', 'B', 0, False]], {0: 1}, {}], [[0, 2, 1]]),\n  ('normal control 5',\n   [[['s4', 'CHEM120', 1, False], ['s5', 'CHEM120', 2, False], ['s1', 'MATH101', 2, True],\n     ['s4', 'PHYS110', 1, False], ['s2', 'MATH101', 0, False], ['s4', 'CHEM120', 0, False],\n     ['s2', 'MATH101H', 2, True], ['s5', 'MATH101', 0, True], ['s4', 'CHEM120', 0, False]],\n    {0: 3, 1: 4, 2: 4},\n    {'MATH101': 'paper', 'MATH101H': 'online', 'PHYS110': 'paper', 'CHEM120': 'paper', 'BIO130': 'paper'}],\n   []),\n  ('normal control 6',\n   [[['s4', 'MATH101H', 2, False], ['s1', 'MATH101', 1, False], ['s5', 'MATH101', 1, False],\n     ['s1', 'MATH101H', 0, False], ['s2', 'MATH101H', 2, False], ['s5', 'CHEM120', 0, True]],\n    {0: 3, 1: 1, 2: 2}, {'MATH101': 'paper', 'MATH101H': 'online', 'PHYS110': 'paper', 'BIO130': 'paper'}],\n   [[1, 2, 1]]),\n  ('normal control 7',\n   [[['s1', 'BIO130', 2, False], ['s3', 'PHYS110', 1, False], ['s3', 'BIO130', 2, False],\n     ['s1', 'BIO130', 1, False], ['s1', 'MATH101', 0, False], ['s2', 'BIO130', 0, True],\n     ['s5', 'BIO130', 1, False], ['s1', 'MATH101H', 2, True], ['s5', 'CHEM120', 1, False],\n     ['s1', 'MATH101', 0, False]],\n    {0: 3, 1: 4, 2: 2},\n    {'MATH101': 'online', 'MATH101H': 'paper', 'PHYS110': 'paper', 'CHEM120': 'online', 'BIO130': 'paper'}],\n   [[2, 4, 2]]),\n  ('normal control 8',\n   [[['s2', 'CHEM120', 1, False], ['s4', 'PHYS110', 2, False], ['s5', 'MATH101', 0, False]],\n    {0: 4, 1: 1, 2: 4},\n    {'MATH101': 'online', 'MATH101H': 'online', 'PHYS110': 'online', 'CHEM120': 'paper', 'BIO130': 'online'}],\n   [])],\n [('regression: duplicate sitting rows 1',\n   [[['s3', 'BIO130', 0, False], ['s3', 'PHYS110', 2, True], ['s1', 'MATH101H', 1, False],\n     ['s1', 'MATH101H', 1, True], ['s1', 'PHYS110', 1, False], ['s3', 'BIO130', 0, False]],\n    {1: 3, 2: 4},\n    {'MATH101': 'paper', 'MATH101H': 'paper', 'PHYS110': 'online', 'CHEM120': 'paper', 'BIO130': 'paper'}],\n   [[0, 1, 0]]),\n  ('regression variant: duplicate sitting rows 2',\n   [[['s3', 'CHEM120', 2, False], ['s2', 'PHYS110', 0, False], ['s3', 'PHYS110', 2, False],\n     ['s2', 'BIO130', 1, False], ['s1', 'MATH101H', 2, False], ['s4', 'CHEM120', 2, False],\n     ['s4', 'CHEM120', 1, True], ['s5', 'MATH101H', 0, False], ['s1', 'MATH101H', 0, False],\n     ['s2', 'PHYS110', 0, False]],\n    {0: 2, 1: 1}, {'MATH101': 'paper', 'MATH101H': 'paper', 'CHEM120': 'paper', 'BIO130': 'online'}],\n   [[2, 4, 0]]),\n  ('boundary control 3', [[['s1', 'A', 0, False], ['s2', 'A', 0, False]], {0: 2}, {'A': 'paper'}], []),\n  ('boundary control 4', [[['s1', 'A', 0, False], ['s2', 'A', 0, False]], {0: 1}, {'A': 'online'}], []),\n  ('normal control 5',\n   [[['s1', 'BIO130', 2, False], ['s3', 'PHYS110', 1, False], ['s3', 'BIO130', 2, False],\n     ['s1', 'BIO130', 1, False], ['s1', 'MATH101', 0, False], ['s2', 'BIO130', 0, True],\n     ['s5', 'BIO130', 1, False], ['s1', 'MATH101H', 2, True], ['s5', 'CHEM120', 1, False],\n     ['s1', 'MATH101', 0, False]],\n    {0: 3, 1: 4, 2: 2},\n    {'MATH101': 'online', 'MATH101H': 'paper', 'PHYS110': 'paper', 'CHEM120': 'online', 'BIO130': 'paper'}],\n   [[2, 4, 2]]),\n  ('normal control 6',\n   [[['s2', 'BIO130', 0, False], ['s2', 'MATH101', 1, False], ['s4', 'CHEM120', 2, True],\n     ['s5', 'MATH101H', 2, False], ['s4', 'PHYS110', 1, True]],\n    {2: 2}, {'MATH101': 'online', 'MATH101H': 'paper', 'CHEM120': 'paper', 'BIO130': 'paper'}],\n   [[0, 1, 0], [1, 2, 0], [2, 3, 2]]),\n  ('normal control 7',\n   [[['s3', 'MATH101', 1, False], ['s5', 'PHYS110', 1, True], ['s2', 'PHYS110', 0, False],\n     ['s1', 'PHYS110', 1, False], ['s1', 'PHYS110', 1, True], ['s3', 'PHYS110', 0, False]],\n    {0: 1, 1: 2, 2: 4},\n    {'MATH101': 'online', 'MATH101H': 'paper', 'PHYS110': 'paper', 'CHEM120': 'online', 'BIO130': 'paper'}],\n   [[0, 2, 1], [1, 3, 2]]),\n  ('normal control 8',\n   [[['s2', 'BIO130', 1, True], ['s4', 'MATH101', 1, False], ['s4', 'MATH101H', 1, True],\n     ['s5', 'MATH101H', 1, True], ['s5', 'PHYS110', 1, False], ['s4', 'MATH101', 2, False],\n     ['s1', 'BIO130', 0, False]],\n    {1: 3, 2: 1}, {'MATH101': 'paper', 'MATH101H': 'paper', 'PHYS110': 'online', 'CHEM120': 'paper'}],\n   [[0, 1, 0], [1, 7, 3]])],\n [('regression: duplicate sitting rows 1',\n   [[['s4', 'MATH101H', 1, False], ['s4', 'MATH101', 1, False], ['s5', 'CHEM120', 2, False],\n     ['s5', 'CHEM120', 2, True], ['s4', 'BIO130', 2, True], ['s1', 'PHYS110', 1, False],\n     ['s4', 'MATH101', 1, False], ['s2', 'PHYS110', 2, True], ['s5', 'CHEM120', 1, False],\n     ['s5', 'MATH101H', 2, False]],\n    {0: 2, 1: 1},\n    {'MATH101': 'paper', 'MATH101H': 'paper', 'PHYS110': 'paper', 'CHEM120': 'paper', 'BIO130': 'paper'}],\n   [[1, 3, 1], [2, 6, 0]]),\n  ('regression variant: duplicate sitting rows 2',\n   [[['s1', 'MATH101', 0, False], ['s1', 'CHEM120', 1, False], ['s1', 'MATH101', 0, False]], {1: 4, 2: 3},\n    {'MATH101': 'paper', 'MATH101H': 'paper', 'PHYS110': 'online', 'BIO130': 'paper'}],\n   [[0, 1, 0]]),\n  ('partial repair guard 3',\n   [[['s1', 'MATH101H', 2, False], ['s3', 'CHEM120', 2, True], ['s4', 'MATH101', 0, False],\n     ['s2', 'PHYS110', 2, False], ['s2', 'CHEM120', 2, True]],\n    {1: 2, 2: 4},\n    {'MATH101': 'paper', 'MATH101H': 'online', 'PHYS110': 'paper', 'CHEM120': 'paper', 'BIO130': 'paper'}],\n   [[0, 1, 0], [2, 5, 4]]),\n  ('boundary control 4', [[['s1', 'A', 0, False], ['s1', 'B', 0, False]], {0: 1}, {}], [[0, 2, 1]]),\n  ('boundary control 5', [[['s1', 'A', 0, False], ['s1', 'A', 0, False]], {0: 1}, {'A': 'paper'}], []),\n  ('normal control 6',\n   [[['s1', 'CHEM120', 1, False], ['s4', 'PHYS110', 0, False], ['s4', 'PHYS110', 0, False]],\n    {0: 4, 1: 2, 2: 4}, {'MATH101H': 'paper', 'CHEM120': 'online', 'BIO130': 'online'}],\n   []),\n  ('normal control 7',\n   [[['s2', 'CHEM120', 1, False], ['s4', 'PHYS110', 2, False], ['s5', 'MATH101', 0, False]],\n    {0: 4, 1: 1, 2: 4},\n    {'MATH101': 'online', 'MATH101H': 'online', 'PHYS110': 'online', 'CHEM120': 'paper', 'BIO130': 'online'}],\n   []),\n  ('normal control 8',\n   [[['s1', 'MATH101', 1, False], ['s5', 'PHYS110', 1, False], ['s3', 'MATH101H', 0, True],\n     ['s2', 'MATH101', 0, False], ['s3', 'BIO130', 1, False], ['s1', 'MATH101', 1, False]],\n    {0: 4, 1: 4, 2: 2}, {'MATH101': 'online', 'MATH101H': 'paper', 'PHYS110': 'paper', 'BIO130': 'paper'}],\n   [])],\n [('regression: duplicate sitting rows 1',\n   [[['s3', 'MATH101H', 2, False], ['s3', 'MATH101H', 0, False], ['s5', 'PHYS110', 0, False],\n     ['s2', 'MATH101H', 0, False], ['s4', 'MATH101H', 0, False], ['s3', 'PHYS110', 1, False],\n     ['s2', 'MATH101', 1, False], ['s5', 'PHYS110', 0, False], ['s4', 'CHEM120', 0, False],\n     ['s3', 'MATH101H', 1, True]],\n    {0: 1, 2: 1},\n    {'MATH101': 'online', 'MATH101H': 'online', 'PHYS110': 'paper', 'CHEM120': 'paper', 'BIO130': 'online'}],\n   [[0, 2, 1], [1, 1, 0]]),\n  ('regression variant: duplicate sitting rows 2',\n   [[['s1', 'MATH101', 0, False], ['s3', 'MATH101H', 2, False], ['s2', 'MATH101H', 2, False],\n     ['s5', 'BIO130', 2, False], ['s2', 'PHYS110', 0, False], ['s4', 'MATH101', 1, False],\n     ['s4', 'PHYS110', 0, False], ['s5', 'MATH101', 0, False], ['s4', 'CHEM120', 1, False],\n     ['s3', 'MATH101H', 2, False]],\n    {0: 1, 1: 4},\n    {'MATH101': 'online', 'MATH101H': 'paper', 'PHYS110': 'paper', 'CHEM120': 'online', 'BIO130': 'paper'}],\n   [[0, 2, 1], [2, 3, 0]]),\n  ('partial repair guard 3',\n   [[['s4', 'PHYS110', 1, False], ['s4', 'BIO130', 1, False], ['s5', 'BIO130', 1, False],\n     ['s5', 'BIO130', 1, False]],\n    {0: 3, 1: 1}, {'MATH101': 'online', 'PHYS110': 'paper', 'CHEM120': 'paper', 'BIO130': 'paper'}],\n   [[1, 3, 1]]),\n  ('boundary control 4', [[['s1', 'A', 0, False], ['s2', 'A', 0, False]], {0: 2}, {'A': 'paper'}], []),\n  ('boundary control 5', [[['s1', 'A', 0, False], ['s2', 'A', 0, False]], {0: 1}, {'A': 'online'}], []),\n  ('normal control 6',\n   [[['s3', 'BIO130', 2, False], ['s1', 'MATH101H', 0, False], ['s5', 'BIO130', 0, False],\n     ['s4', 'PHYS110', 0, False], ['s2', 'MATH101', 0, False], ['s2', 'BIO130', 0, True],\n     ['s3', 'BIO130', 2, False]],\n    {0: 3, 1: 4, 2: 3}, {'MATH101': 'paper', 'MATH101H': 'online', 'PHYS110': 'paper', 'BIO130': 'online'}],\n   []),\n  ('normal control 7',\n   [[['s4', 'PHYS110', 0, False], ['s1', 'BIO130', 1, False], ['s1', 'MATH101H', 0, False],\n     ['s5', 'BIO130', 0, False], ['s4', 'CHEM120', 2, False], ['s4', 'CHEM120', 2, False]],\n    {0: 3, 1: 1, 2: 4},\n    {'MATH101': 'online', 'MATH101H': 'online', 'PHYS110': 'paper', 'CHEM120': 'paper', 'BIO130': 'paper'}],\n   []),\n  ('normal control 8',\n   [[['s2', 'MATH101', 2, False], ['s4', 'BIO130', 1, True], ['s4', 'CHEM120', 0, True],\n     ['s2', 'MATH101', 2, False], ['s4', 'MATH101H', 0, False], ['s5', 'CHEM120', 2, False],\n     ['s4', 'MATH101H', 0, False], ['s5', 'CHEM120', 1, False]],\n    {0: 2, 1: 4, 2: 3}, {'MATH101H': 'online', 'PHYS110': 'paper', 'BIO130': 'online'}],\n   [])],\n [('regression: duplicate sitting rows 1',\n   [[['s1', 'BIO130', 0, False], ['s1', 'PHYS110', 0, True], ['s5', 'CHEM120', 1, False],\n     ['s1', 'BIO130', 0, False], ['s2', 'CHEM120', 2, False], ['s1', 'BIO130', 0, False]],\n    {0: 3, 1: 4, 2: 2},\n    {'MATH101': 'paper', 'MATH101H': 'paper', 'PHYS110': 'paper', 'CHEM120': 'paper', 'BIO130': 'paper'}],\n   []),\n  ('regression variant: duplicate sitting rows 2',\n   [[['s3', 'BIO130', 2, False], ['s4', 'MATH101', 2, True], ['s4', 'MATH101H', 0, True],\n     ['s2', 'PHYS110', 2, False], ['s4', 'MATH101', 2, False], ['s5', 'PHYS110', 1, False],\n     ['s2', 'PHYS110', 2, False]],\n    {0: 2, 1: 2},\n    {'MATH101': 'paper', 'MATH101H': 'online', 'PHYS110': 'online', 'CHEM120': 'online', 'BIO130': 'paper'}],\n   [[2, 3, 0]]),\n  ('partial repair guard 3',\n   [[['s1', 'MATH101', 0, False], ['s3', 'MATH101H', 1, False], ['s2', 'CHEM120', 1, False],\n     ['s3', 'MATH101H', 2, False], ['s3', 'MATH101', 1, False], ['s1', 'MATH101H', 2, True],\n     ['s5', 'PHYS110', 0, False], ['s5', 'CHEM120', 2, False], ['s2', 'MATH101', 2, False],\n     ['s2', 'PHYS110', 0, False], ['s5', 'PHYS110', 0, False]],\n    {0: 2, 2: 1}, {'MATH101': 'paper', 'MATH101H': 'paper', 'PHYS110': 'online'}],\n   [[1, 3, 0], [2, 4, 1]]),\n  ('boundary control 4', [[['s1', 'A', 0, False], ['s1', 'B', 0, False]], {0: 1}, {}], [[0, 2, 1]]),\n  ('boundary control 5', [[['s1', 'A', 0, False], ['s1', 'A', 0, False]], {0: 1}, {'A': 'paper'}], []),\n  ('normal control 6',\n   [[['s4', 'BIO130', 2, False], ['s3', 'BIO130', 2, True], ['s4', 'BIO130', 2, False]], {0: 4, 1: 3, 2: 4},\n    {'MATH101': 'paper', 'MATH101H': 'online', 'PHYS110': 'paper', 'CHEM120': 'online', 'BIO130': 'paper'}],\n   []),\n  ('normal control 7',\n   [[['s5', 'PHYS110', 2, False], ['s4', 'MATH101', 0, False], ['s5', 'MATH101H', 2, True],\n     ['s2', 'CHEM120', 2, False], ['s1', 'BIO130', 0, False], ['s2', 'BIO130', 0, False],\n     ['s2', 'PHYS110', 2, True], ['s1', 'CHEM120', 1, False], ['s1', 'CHEM120', 1, False],\n     ['s4', 'BIO130', 0, False]],\n    {0: 4, 1: 2, 2: 3},\n    {'MATH101': 'paper', 'MATH101H': 'paper', 'PHYS110': 'paper', 'CHEM120': 'paper', 'BIO130': 'paper'}],\n   [[2, 6, 3]]),\n  ('normal control 8',\n   [[['s2', 'PHYS110', 2, False], ['s4', 'CHEM120', 0, True], ['s2', 'PHYS110', 0, True]], {1: 3, 2: 3},\n    {'MATH101H': 'paper', 'PHYS110': 'paper', 'CHEM120': 'paper'}],\n   [[0, 2, 0]])]]\nfor label, args, expected in fixtures[N-1]:\n    check(label, solve(*args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"broken":{"sha256":"0209407035478e1f9b0cf895e8df2185cda45ea1e6c8fe6e7f9f2e2c222bd873","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(sits, cap, mode):\n    seen = set()\n    used = {}\n    for st, ex, p, acc in sits:\n        seen.add((st, ex))\n        if mode.get(ex) == 'online':\n            continue\n        used[p] = used.get(p, 0) + (2 if acc else 1)\n    return [[p, used[p], cap.get(p, 0)] for p in sorted(used) if used[p] > cap.get(p, 0)]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression: duplicate sitting rows 1',\n   [[['s1', 'A', 0, False], ['s1', 'A', 0, False]], {0: 1}, {'A': 'paper'}], []),\n  ('regression variant: duplicate sitting rows 2',\n   [[['s2', 'PHYS110', 0, False], ['s1', 'BIO130', 2, True], ['s1', 'BIO130', 2, True]], {0: 4, 1: 3, 2: 3},\n    {'MATH101': 'online', 'PHYS110': 'paper', 'BIO130': 'paper'}],\n   []),\n  ('partial repair guard 3',\n   [[['s5', 'BIO130', 1, False], ['s3', 'BIO130', 1, False], ['s5', 'PHYS110', 1, False],\n     ['s3', 'BIO130', 2, False], ['s4', 'BIO130', 2, False]],\n    {0: 3, 1: 1, 2: 2}, {'MATH101H': 'paper', 'PHYS110': 'paper', 'CHEM120': 'online'}],\n   [[1, 3, 1]]),\n  ('boundary control 4', [[['s1', 'A', 0, False], ['s1', 'B', 0, False]], {0: 1}, {}], [[0, 2, 1]]),\n  ('normal control 5',\n   [[['s4', 'CHEM120', 1, False], ['s5', 'CHEM120', 2, False], ['s1', 'MATH101', 2, True],\n     ['s4', 'PHYS110', 1, False], ['s2', 'MATH101', 0, False], ['s4', 'CHEM120', 0, False],\n     ['s2', 'MATH101H', 2, True], ['s5', 'MATH101', 0, True], ['s4', 'CHEM120', 0, False]],\n    {0: 3, 1: 4, 2: 4},\n    {'MATH101': 'paper', 'MATH101H': 'online', 'PHYS110': 'paper', 'CHEM120': 'paper', 'BIO130': 'paper'}],\n   []),\n  ('normal control 6',\n   [[['s4', 'MATH101H', 2, False], ['s1', 'MATH101', 1, False], ['s5', 'MATH101', 1, False],\n     ['s1', 'MATH101H', 0, False], ['s2', 'MATH101H', 2, False], ['s5', 'CHEM120', 0, True]],\n    {0: 3, 1: 1, 2: 2}, {'MATH101': 'paper', 'MATH101H': 'online', 'PHYS110': 'paper', 'BIO130': 'paper'}],\n   [[1, 2, 1]]),\n  ('normal control 7',\n   [[['s1', 'BIO130', 2, False], ['s3', 'PHYS110', 1, False], ['s3', 'BIO130', 2, False],\n     ['s1', 'BIO130', 1, False], ['s1', 'MATH101', 0, False], ['s2', 'BIO130', 0, True],\n     ['s5', 'BIO130', 1, False], ['s1', 'MATH101H', 2, True], ['s5', 'CHEM120', 1, False],\n     ['s1', 'MATH101', 0, False]],\n    {0: 3, 1: 4, 2: 2},\n    {'MATH101': 'online', 'MATH101H': 'paper', 'PHYS110': 'paper', 'CHEM120': 'online', 'BIO130': 'paper'}],\n   [[2, 4, 2]]),\n  ('normal control 8',\n   [[['s2', 'CHEM120', 1, False], ['s4', 'PHYS110', 2, False], ['s5', 'MATH101', 0, False]],\n    {0: 4, 1: 1, 2: 4},\n    {'MATH101': 'online', 'MATH101H': 'online', 'PHYS110': 'online', 'CHEM120': 'paper', 'BIO130': 'online'}],\n   [])],\n [('regression: duplicate sitting rows 1',\n   [[['s3', 'BIO130', 0, False], ['s3', 'PHYS110', 2, True], ['s1', 'MATH101H', 1, False],\n     ['s1', 'MATH101H', 1, True], ['s1', 'PHYS110', 1, False], ['s3', 'BIO130', 0, False]],\n    {1: 3, 2: 4},\n    {'MATH101': 'paper', 'MATH101H': 'paper', 'PHYS110': 'online', 'CHEM120': 'paper', 'BIO130': 'paper'}],\n   [[0, 1, 0]]),\n  ('regression variant: duplicate sitting rows 2',\n   [[['s3', 'CHEM120', 2, False], ['s2', 'PHYS110', 0, False], ['s3', 'PHYS110', 2, False],\n     ['s2', 'BIO130', 1, False], ['s1', 'MATH101H', 2, False], ['s4', 'CHEM120', 2, False],\n     ['s4', 'CHEM120', 1, True], ['s5', 'MATH101H', 0, False], ['s1', 'MATH101H', 0, False],\n     ['s2', 'PHYS110', 0, False]],\n    {0: 2, 1: 1}, {'MATH101': 'paper', 'MATH101H': 'paper', 'CHEM120': 'paper', 'BIO130': 'online'}],\n   [[2, 4, 0]]),\n  ('boundary control 3', [[['s1', 'A', 0, False], ['s2', 'A', 0, False]], {0: 2}, {'A': 'paper'}], []),\n  ('boundary control 4', [[['s1', 'A', 0, False], ['s2', 'A', 0, False]], {0: 1}, {'A': 'online'}], []),\n  ('normal control 5',\n   [[['s1', 'BIO130', 2, False], ['s3', 'PHYS110', 1, False], ['s3', 'BIO130', 2, False],\n     ['s1', 'BIO130', 1, False], ['s1', 'MATH101', 0, False], ['s2', 'BIO130', 0, True],\n     ['s5', 'BIO130', 1, False], ['s1', 'MATH101H', 2, True], ['s5', 'CHEM120', 1, False],\n     ['s1', 'MATH101', 0, False]],\n    {0: 3, 1: 4, 2: 2},\n    {'MATH101': 'online', 'MATH101H': 'paper', 'PHYS110': 'paper', 'CHEM120': 'online', 'BIO130': 'paper'}],\n   [[2, 4, 2]]),\n  ('normal control 6',\n   [[['s2', 'BIO130', 0, False], ['s2', 'MATH101', 1, False], ['s4', 'CHEM120', 2, True],\n     ['s5', 'MATH101H', 2, False], ['s4', 'PHYS110', 1, True]],\n    {2: 2}, {'MATH101': 'online', 'MATH101H': 'paper', 'CHEM120': 'paper', 'BIO130': 'paper'}],\n   [[0, 1, 0], [1, 2, 0], [2, 3, 2]]),\n  ('normal control 7',\n   [[['s3', 'MATH101', 1, False], ['s5', 'PHYS110', 1, True], ['s2', 'PHYS110', 0, False],\n     ['s1', 'PHYS110', 1, False], ['s1', 'PHYS110', 1, True], ['s3', 'PHYS110', 0, False]],\n    {0: 1, 1: 2, 2: 4},\n    {'MATH101': 'online', 'MATH101H': 'paper', 'PHYS110': 'paper', 'CHEM120': 'online', 'BIO130': 'paper'}],\n   [[0, 2, 1], [1, 3, 2]]),\n  ('normal control 8',\n   [[['s2', 'BIO130', 1, True], ['s4', 'MATH101', 1, False], ['s4', 'MATH101H', 1, True],\n     ['s5', 'MATH101H', 1, True], ['s5', 'PHYS110', 1, False], ['s4', 'MATH101', 2, False],\n     ['s1', 'BIO130', 0, False]],\n    {1: 3, 2: 1}, {'MATH101': 'paper', 'MATH101H': 'paper', 'PHYS110': 'online', 'CHEM120': 'paper'}],\n   [[0, 1, 0], [1, 7, 3]])],\n [('regression: duplicate sitting rows 1',\n   [[['s4', 'MATH101H', 1, False], ['s4', 'MATH101', 1, False], ['s5', 'CHEM120', 2, False],\n     ['s5', 'CHEM120', 2, True], ['s4', 'BIO130', 2, True], ['s1', 'PHYS110', 1, False],\n     ['s4', 'MATH101', 1, False], ['s2', 'PHYS110', 2, True], ['s5', 'CHEM120', 1, False],\n     ['s5', 'MATH101H', 2, False]],\n    {0: 2, 1: 1},\n    {'MATH101': 'paper', 'MATH101H': 'paper', 'PHYS110': 'paper', 'CHEM120': 'paper', 'BIO130': 'paper'}],\n   [[1, 3, 1], [2, 6, 0]]),\n  ('regression variant: duplicate sitting rows 2',\n   [[['s1', 'MATH101', 0, False], ['s1', 'CHEM120', 1, False], ['s1', 'MATH101', 0, False]], {1: 4, 2: 3},\n    {'MATH101': 'paper', 'MATH101H': 'paper', 'PHYS110': 'online', 'BIO130': 'paper'}],\n   [[0, 1, 0]]),\n  ('partial repair guard 3',\n   [[['s1', 'MATH101H', 2, False], ['s3', 'CHEM120', 2, True], ['s4', 'MATH101', 0, False],\n     ['s2', 'PHYS110', 2, False], ['s2', 'CHEM120', 2, True]],\n    {1: 2, 2: 4},\n    {'MATH101': 'paper', 'MATH101H': 'online', 'PHYS110': 'paper', 'CHEM120': 'paper', 'BIO130': 'paper'}],\n   [[0, 1, 0], [2, 5, 4]]),\n  ('boundary control 4', [[['s1', 'A', 0, False], ['s1', 'B', 0, False]], {0: 1}, {}], [[0, 2, 1]]),\n  ('boundary control 5', [[['s1', 'A', 0, False], ['s1', 'A', 0, False]], {0: 1}, {'A': 'paper'}], []),\n  ('normal control 6',\n   [[['s1', 'CHEM120', 1, False], ['s4', 'PHYS110', 0, False], ['s4', 'PHYS110', 0, False]],\n    {0: 4, 1: 2, 2: 4}, {'MATH101H': 'paper', 'CHEM120': 'online', 'BIO130': 'online'}],\n   []),\n  ('normal control 7',\n   [[['s2', 'CHEM120', 1, False], ['s4', 'PHYS110', 2, False], ['s5', 'MATH101', 0, False]],\n    {0: 4, 1: 1, 2: 4},\n    {'MATH101': 'online', 'MATH101H': 'online', 'PHYS110': 'online', 'CHEM120': 'paper', 'BIO130': 'online'}],\n   []),\n  ('normal control 8',\n   [[['s1', 'MATH101', 1, False], ['s5', 'PHYS110', 1, False], ['s3', 'MATH101H', 0, True],\n     ['s2', 'MATH101', 0, False], ['s3', 'BIO130', 1, False], ['s1', 'MATH101', 1, False]],\n    {0: 4, 1: 4, 2: 2}, {'MATH101': 'online', 'MATH101H': 'paper', 'PHYS110': 'paper', 'BIO130': 'paper'}],\n   [])],\n [('regression: duplicate sitting rows 1',\n   [[['s3', 'MATH101H', 2, False], ['s3', 'MATH101H', 0, False], ['s5', 'PHYS110', 0, False],\n     ['s2', 'MATH101H', 0, False], ['s4', 'MATH101H', 0, False], ['s3', 'PHYS110', 1, False],\n     ['s2', 'MATH101', 1, False], ['s5', 'PHYS110', 0, False], ['s4', 'CHEM120', 0, False],\n     ['s3', 'MATH101H', 1, True]],\n    {0: 1, 2: 1},\n    {'MATH101': 'online', 'MATH101H': 'online', 'PHYS110': 'paper', 'CHEM120': 'paper', 'BIO130': 'online'}],\n   [[0, 2, 1], [1, 1, 0]]),\n  ('regression variant: duplicate sitting rows 2',\n   [[['s1', 'MATH101', 0, False], ['s3', 'MATH101H', 2, False], ['s2', 'MATH101H', 2, False],\n     ['s5', 'BIO130', 2, False], ['s2', 'PHYS110', 0, False], ['s4', 'MATH101', 1, False],\n     ['s4', 'PHYS110', 0, False], ['s5', 'MATH101', 0, False], ['s4', 'CHEM120', 1, False],\n     ['s3', 'MATH101H', 2, False]],\n    {0: 1, 1: 4},\n    {'MATH101': 'online', 'MATH101H': 'paper', 'PHYS110': 'paper', 'CHEM120': 'online', 'BIO130': 'paper'}],\n   [[0, 2, 1], [2, 3, 0]]),\n  ('partial repair guard 3',\n   [[['s4', 'PHYS110', 1, False], ['s4', 'BIO130', 1, False], ['s5', 'BIO130', 1, False],\n     ['s5', 'BIO130', 1, False]],\n    {0: 3, 1: 1}, {'MATH101': 'online', 'PHYS110': 'paper', 'CHEM120': 'paper', 'BIO130': 'paper'}],\n   [[1, 3, 1]]),\n  ('boundary control 4', [[['s1', 'A', 0, False], ['s2', 'A', 0, False]], {0: 2}, {'A': 'paper'}], []),\n  ('boundary control 5', [[['s1', 'A', 0, False], ['s2', 'A', 0, False]], {0: 1}, {'A': 'online'}], []),\n  ('normal control 6',\n   [[['s3', 'BIO130', 2, False], ['s1', 'MATH101H', 0, False], ['s5', 'BIO130', 0, False],\n     ['s4', 'PHYS110', 0, False], ['s2', 'MATH101', 0, False], ['s2', 'BIO130', 0, True],\n     ['s3', 'BIO130', 2, False]],\n    {0: 3, 1: 4, 2: 3}, {'MATH101': 'paper', 'MATH101H': 'online', 'PHYS110': 'paper', 'BIO130': 'online'}],\n   []),\n  ('normal control 7',\n   [[['s4', 'PHYS110', 0, False], ['s1', 'BIO130', 1, False], ['s1', 'MATH101H', 0, False],\n     ['s5', 'BIO130', 0, False], ['s4', 'CHEM120', 2, False], ['s4', 'CHEM120', 2, False]],\n    {0: 3, 1: 1, 2: 4},\n    {'MATH101': 'online', 'MATH101H': 'online', 'PHYS110': 'paper', 'CHEM120': 'paper', 'BIO130': 'paper'}],\n   []),\n  ('normal control 8',\n   [[['s2', 'MATH101', 2, False], ['s4', 'BIO130', 1, True], ['s4', 'CHEM120', 0, True],\n     ['s2', 'MATH101', 2, False], ['s4', 'MATH101H', 0, False], ['s5', 'CHEM120', 2, False],\n     ['s4', 'MATH101H', 0, False], ['s5', 'CHEM120', 1, False]],\n    {0: 2, 1: 4, 2: 3}, {'MATH101H': 'online', 'PHYS110': 'paper', 'BIO130': 'online'}],\n   [])],\n [('regression: duplicate sitting rows 1',\n   [[['s1', 'BIO130', 0, False], ['s1', 'PHYS110', 0, True], ['s5', 'CHEM120', 1, False],\n     ['s1', 'BIO130', 0, False], ['s2', 'CHEM120', 2, False], ['s1', 'BIO130', 0, False]],\n    {0: 3, 1: 4, 2: 2},\n    {'MATH101': 'paper', 'MATH101H': 'paper', 'PHYS110': 'paper', 'CHEM120': 'paper', 'BIO130': 'paper'}],\n   []),\n  ('regression variant: duplicate sitting rows 2',\n   [[['s3', 'BIO130', 2, False], ['s4', 'MATH101', 2, True], ['s4', 'MATH101H', 0, True],\n     ['s2', 'PHYS110', 2, False], ['s4', 'MATH101', 2, False], ['s5', 'PHYS110', 1, False],\n     ['s2', 'PHYS110', 2, False]],\n    {0: 2, 1: 2},\n    {'MATH101': 'paper', 'MATH101H': 'online', 'PHYS110': 'online', 'CHEM120': 'online', 'BIO130': 'paper'}],\n   [[2, 3, 0]]),\n  ('partial repair guard 3',\n   [[['s1', 'MATH101', 0, False], ['s3', 'MATH101H', 1, False], ['s2', 'CHEM120', 1, False],\n     ['s3', 'MATH101H', 2, False], ['s3', 'MATH101', 1, False], ['s1', 'MATH101H', 2, True],\n     ['s5', 'PHYS110', 0, False], ['s5', 'CHEM120', 2, False], ['s2', 'MATH101', 2, False],\n     ['s2', 'PHYS110', 0, False], ['s5', 'PHYS110', 0, False]],\n    {0: 2, 2: 1}, {'MATH101': 'paper', 'MATH101H': 'paper', 'PHYS110': 'online'}],\n   [[1, 3, 0], [2, 4, 1]]),\n  ('boundary control 4', [[['s1', 'A', 0, False], ['s1', 'B', 0, False]], {0: 1}, {}], [[0, 2, 1]]),\n  ('boundary control 5', [[['s1', 'A', 0, False], ['s1', 'A', 0, False]], {0: 1}, {'A': 'paper'}], []),\n  ('normal control 6',\n   [[['s4', 'BIO130', 2, False], ['s3', 'BIO130', 2, True], ['s4', 'BIO130', 2, False]], {0: 4, 1: 3, 2: 4},\n    {'MATH101': 'paper', 'MATH101H': 'online', 'PHYS110': 'paper', 'CHEM120': 'online', 'BIO130': 'paper'}],\n   []),\n  ('normal control 7',\n   [[['s5', 'PHYS110', 2, False], ['s4', 'MATH101', 0, False], ['s5', 'MATH101H', 2, True],\n     ['s2', 'CHEM120', 2, False], ['s1', 'BIO130', 0, False], ['s2', 'BIO130', 0, False],\n     ['s2', 'PHYS110', 2, True], ['s1', 'CHEM120', 1, False], ['s1', 'CHEM120', 1, False],\n     ['s4', 'BIO130', 0, False]],\n    {0: 4, 1: 2, 2: 3},\n    {'MATH101': 'paper', 'MATH101H': 'paper', 'PHYS110': 'paper', 'CHEM120': 'paper', 'BIO130': 'paper'}],\n   [[2, 6, 3]]),\n  ('normal control 8',\n   [[['s2', 'PHYS110', 2, False], ['s4', 'CHEM120', 0, True], ['s2', 'PHYS110', 0, True]], {1: 3, 2: 3},\n    {'MATH101H': 'paper', 'PHYS110': 'paper', 'CHEM120': 'paper'}],\n   [[0, 2, 0]])]]\nfor label, args, expected in fixtures[N-1]:\n    check(label, solve(*args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"fixed":{"sha256":"724c20febe74ebe9c04e150e4685df0d0052be5ce1459ac23216de4f33cb3aed","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(sits, cap, mode):\n    seen = set()\n    used = {}\n    for st, ex, p, acc in sits:\n        if (st, ex) in seen:\n            continue\n        seen.add((st, ex))\n        if mode.get(ex) == 'online':\n            continue\n        used[p] = used.get(p, 0) + (2 if acc else 1)\n    return [[p, used[p], cap.get(p, 0)] for p in sorted(used) if used[p] > cap.get(p, 0)]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression: duplicate sitting rows 1',\n   [[['s1', 'A', 0, False], ['s1', 'A', 0, False]], {0: 1}, {'A': 'paper'}], []),\n  ('regression variant: duplicate sitting rows 2',\n   [[['s2', 'PHYS110', 0, False], ['s1', 'BIO130', 2, True], ['s1', 'BIO130', 2, True]], {0: 4, 1: 3, 2: 3},\n    {'MATH101': 'online', 'PHYS110': 'paper', 'BIO130': 'paper'}],\n   []),\n  ('partial repair guard 3',\n   [[['s5', 'BIO130', 1, False], ['s3', 'BIO130', 1, False], ['s5', 'PHYS110', 1, False],\n     ['s3', 'BIO130', 2, False], ['s4', 'BIO130', 2, False]],\n    {0: 3, 1: 1, 2: 2}, {'MATH101H': 'paper', 'PHYS110': 'paper', 'CHEM120': 'online'}],\n   [[1, 3, 1]]),\n  ('boundary control 4', [[['s1', 'A', 0, False], ['s1', 'B', 0, False]], {0: 1}, {}], [[0, 2, 1]]),\n  ('normal control 5',\n   [[['s4', 'CHEM120', 1, False], ['s5', 'CHEM120', 2, False], ['s1', 'MATH101', 2, True],\n     ['s4', 'PHYS110', 1, False], ['s2', 'MATH101', 0, False], ['s4', 'CHEM120', 0, False],\n     ['s2', 'MATH101H', 2, True], ['s5', 'MATH101', 0, True], ['s4', 'CHEM120', 0, False]],\n    {0: 3, 1: 4, 2: 4},\n    {'MATH101': 'paper', 'MATH101H': 'online', 'PHYS110': 'paper', 'CHEM120': 'paper', 'BIO130': 'paper'}],\n   []),\n  ('normal control 6',\n   [[['s4', 'MATH101H', 2, False], ['s1', 'MATH101', 1, False], ['s5', 'MATH101', 1, False],\n     ['s1', 'MATH101H', 0, False], ['s2', 'MATH101H', 2, False], ['s5', 'CHEM120', 0, True]],\n    {0: 3, 1: 1, 2: 2}, {'MATH101': 'paper', 'MATH101H': 'online', 'PHYS110': 'paper', 'BIO130': 'paper'}],\n   [[1, 2, 1]]),\n  ('normal control 7',\n   [[['s1', 'BIO130', 2, False], ['s3', 'PHYS110', 1, False], ['s3', 'BIO130', 2, False],\n     ['s1', 'BIO130', 1, False], ['s1', 'MATH101', 0, False], ['s2', 'BIO130', 0, True],\n     ['s5', 'BIO130', 1, False], ['s1', 'MATH101H', 2, True], ['s5', 'CHEM120', 1, False],\n     ['s1', 'MATH101', 0, False]],\n    {0: 3, 1: 4, 2: 2},\n    {'MATH101': 'online', 'MATH101H': 'paper', 'PHYS110': 'paper', 'CHEM120': 'online', 'BIO130': 'paper'}],\n   [[2, 4, 2]]),\n  ('normal control 8',\n   [[['s2', 'CHEM120', 1, False], ['s4', 'PHYS110', 2, False], ['s5', 'MATH101', 0, False]],\n    {0: 4, 1: 1, 2: 4},\n    {'MATH101': 'online', 'MATH101H': 'online', 'PHYS110': 'online', 'CHEM120': 'paper', 'BIO130': 'online'}],\n   [])],\n [('regression: duplicate sitting rows 1',\n   [[['s3', 'BIO130', 0, False], ['s3', 'PHYS110', 2, True], ['s1', 'MATH101H', 1, False],\n     ['s1', 'MATH101H', 1, True], ['s1', 'PHYS110', 1, False], ['s3', 'BIO130', 0, False]],\n    {1: 3, 2: 4},\n    {'MATH101': 'paper', 'MATH101H': 'paper', 'PHYS110': 'online', 'CHEM120': 'paper', 'BIO130': 'paper'}],\n   [[0, 1, 0]]),\n  ('regression variant: duplicate sitting rows 2',\n   [[['s3', 'CHEM120', 2, False], ['s2', 'PHYS110', 0, False], ['s3', 'PHYS110', 2, False],\n     ['s2', 'BIO130', 1, False], ['s1', 'MATH101H', 2, False], ['s4', 'CHEM120', 2, False],\n     ['s4', 'CHEM120', 1, True], ['s5', 'MATH101H', 0, False], ['s1', 'MATH101H', 0, False],\n     ['s2', 'PHYS110', 0, False]],\n    {0: 2, 1: 1}, {'MATH101': 'paper', 'MATH101H': 'paper', 'CHEM120': 'paper', 'BIO130': 'online'}],\n   [[2, 4, 0]]),\n  ('boundary control 3', [[['s1', 'A', 0, False], ['s2', 'A', 0, False]], {0: 2}, {'A': 'paper'}], []),\n  ('boundary control 4', [[['s1', 'A', 0, False], ['s2', 'A', 0, False]], {0: 1}, {'A': 'online'}], []),\n  ('normal control 5',\n   [[['s1', 'BIO130', 2, False], ['s3', 'PHYS110', 1, False], ['s3', 'BIO130', 2, False],\n     ['s1', 'BIO130', 1, False], ['s1', 'MATH101', 0, False], ['s2', 'BIO130', 0, True],\n     ['s5', 'BIO130', 1, False], ['s1', 'MATH101H', 2, True], ['s5', 'CHEM120', 1, False],\n     ['s1', 'MATH101', 0, False]],\n    {0: 3, 1: 4, 2: 2},\n    {'MATH101': 'online', 'MATH101H': 'paper', 'PHYS110': 'paper', 'CHEM120': 'online', 'BIO130': 'paper'}],\n   [[2, 4, 2]]),\n  ('normal control 6',\n   [[['s2', 'BIO130', 0, False], ['s2', 'MATH101', 1, False], ['s4', 'CHEM120', 2, True],\n     ['s5', 'MATH101H', 2, False], ['s4', 'PHYS110', 1, True]],\n    {2: 2}, {'MATH101': 'online', 'MATH101H': 'paper', 'CHEM120': 'paper', 'BIO130': 'paper'}],\n   [[0, 1, 0], [1, 2, 0], [2, 3, 2]]),\n  ('normal control 7',\n   [[['s3', 'MATH101', 1, False], ['s5', 'PHYS110', 1, True], ['s2', 'PHYS110', 0, False],\n     ['s1', 'PHYS110', 1, False], ['s1', 'PHYS110', 1, True], ['s3', 'PHYS110', 0, False]],\n    {0: 1, 1: 2, 2: 4},\n    {'MATH101': 'online', 'MATH101H': 'paper', 'PHYS110': 'paper', 'CHEM120': 'online', 'BIO130': 'paper'}],\n   [[0, 2, 1], [1, 3, 2]]),\n  ('normal control 8',\n   [[['s2', 'BIO130', 1, True], ['s4', 'MATH101', 1, False], ['s4', 'MATH101H', 1, True],\n     ['s5', 'MATH101H', 1, True], ['s5', 'PHYS110', 1, False], ['s4', 'MATH101', 2, False],\n     ['s1', 'BIO130', 0, False]],\n    {1: 3, 2: 1}, {'MATH101': 'paper', 'MATH101H': 'paper', 'PHYS110': 'online', 'CHEM120': 'paper'}],\n   [[0, 1, 0], [1, 7, 3]])],\n [('regression: duplicate sitting rows 1',\n   [[['s4', 'MATH101H', 1, False], ['s4', 'MATH101', 1, False], ['s5', 'CHEM120', 2, False],\n     ['s5', 'CHEM120', 2, True], ['s4', 'BIO130', 2, True], ['s1', 'PHYS110', 1, False],\n     ['s4', 'MATH101', 1, False], ['s2', 'PHYS110', 2, True], ['s5', 'CHEM120', 1, False],\n     ['s5', 'MATH101H', 2, False]],\n    {0: 2, 1: 1},\n    {'MATH101': 'paper', 'MATH101H': 'paper', 'PHYS110': 'paper', 'CHEM120': 'paper', 'BIO130': 'paper'}],\n   [[1, 3, 1], [2, 6, 0]]),\n  ('regression variant: duplicate sitting rows 2',\n   [[['s1', 'MATH101', 0, False], ['s1', 'CHEM120', 1, False], ['s1', 'MATH101', 0, False]], {1: 4, 2: 3},\n    {'MATH101': 'paper', 'MATH101H': 'paper', 'PHYS110': 'online', 'BIO130': 'paper'}],\n   [[0, 1, 0]]),\n  ('partial repair guard 3',\n   [[['s1', 'MATH101H', 2, False], ['s3', 'CHEM120', 2, True], ['s4', 'MATH101', 0, False],\n     ['s2', 'PHYS110', 2, False], ['s2', 'CHEM120', 2, True]],\n    {1: 2, 2: 4},\n    {'MATH101': 'paper', 'MATH101H': 'online', 'PHYS110': 'paper', 'CHEM120': 'paper', 'BIO130': 'paper'}],\n   [[0, 1, 0], [2, 5, 4]]),\n  ('boundary control 4', [[['s1', 'A', 0, False], ['s1', 'B', 0, False]], {0: 1}, {}], [[0, 2, 1]]),\n  ('boundary control 5', [[['s1', 'A', 0, False], ['s1', 'A', 0, False]], {0: 1}, {'A': 'paper'}], []),\n  ('normal control 6',\n   [[['s1', 'CHEM120', 1, False], ['s4', 'PHYS110', 0, False], ['s4', 'PHYS110', 0, False]],\n    {0: 4, 1: 2, 2: 4}, {'MATH101H': 'paper', 'CHEM120': 'online', 'BIO130': 'online'}],\n   []),\n  ('normal control 7',\n   [[['s2', 'CHEM120', 1, False], ['s4', 'PHYS110', 2, False], ['s5', 'MATH101', 0, False]],\n    {0: 4, 1: 1, 2: 4},\n    {'MATH101': 'online', 'MATH101H': 'online', 'PHYS110': 'online', 'CHEM120': 'paper', 'BIO130': 'online'}],\n   []),\n  ('normal control 8',\n   [[['s1', 'MATH101', 1, False], ['s5', 'PHYS110', 1, False], ['s3', 'MATH101H', 0, True],\n     ['s2', 'MATH101', 0, False], ['s3', 'BIO130', 1, False], ['s1', 'MATH101', 1, False]],\n    {0: 4, 1: 4, 2: 2}, {'MATH101': 'online', 'MATH101H': 'paper', 'PHYS110': 'paper', 'BIO130': 'paper'}],\n   [])],\n [('regression: duplicate sitting rows 1',\n   [[['s3', 'MATH101H', 2, False], ['s3', 'MATH101H', 0, False], ['s5', 'PHYS110', 0, False],\n     ['s2', 'MATH101H', 0, False], ['s4', 'MATH101H', 0, False], ['s3', 'PHYS110', 1, False],\n     ['s2', 'MATH101', 1, False], ['s5', 'PHYS110', 0, False], ['s4', 'CHEM120', 0, False],\n     ['s3', 'MATH101H', 1, True]],\n    {0: 1, 2: 1},\n    {'MATH101': 'online', 'MATH101H': 'online', 'PHYS110': 'paper', 'CHEM120': 'paper', 'BIO130': 'online'}],\n   [[0, 2, 1], [1, 1, 0]]),\n  ('regression variant: duplicate sitting rows 2',\n   [[['s1', 'MATH101', 0, False], ['s3', 'MATH101H', 2, False], ['s2', 'MATH101H', 2, False],\n     ['s5', 'BIO130', 2, False], ['s2', 'PHYS110', 0, False], ['s4', 'MATH101', 1, False],\n     ['s4', 'PHYS110', 0, False], ['s5', 'MATH101', 0, False], ['s4', 'CHEM120', 1, False],\n     ['s3', 'MATH101H', 2, False]],\n    {0: 1, 1: 4},\n    {'MATH101': 'online', 'MATH101H': 'paper', 'PHYS110': 'paper', 'CHEM120': 'online', 'BIO130': 'paper'}],\n   [[0, 2, 1], [2, 3, 0]]),\n  ('partial repair guard 3',\n   [[['s4', 'PHYS110', 1, False], ['s4', 'BIO130', 1, False], ['s5', 'BIO130', 1, False],\n     ['s5', 'BIO130', 1, False]],\n    {0: 3, 1: 1}, {'MATH101': 'online', 'PHYS110': 'paper', 'CHEM120': 'paper', 'BIO130': 'paper'}],\n   [[1, 3, 1]]),\n  ('boundary control 4', [[['s1', 'A', 0, False], ['s2', 'A', 0, False]], {0: 2}, {'A': 'paper'}], []),\n  ('boundary control 5', [[['s1', 'A', 0, False], ['s2', 'A', 0, False]], {0: 1}, {'A': 'online'}], []),\n  ('normal control 6',\n   [[['s3', 'BIO130', 2, False], ['s1', 'MATH101H', 0, False], ['s5', 'BIO130', 0, False],\n     ['s4', 'PHYS110', 0, False], ['s2', 'MATH101', 0, False], ['s2', 'BIO130', 0, True],\n     ['s3', 'BIO130', 2, False]],\n    {0: 3, 1: 4, 2: 3}, {'MATH101': 'paper', 'MATH101H': 'online', 'PHYS110': 'paper', 'BIO130': 'online'}],\n   []),\n  ('normal control 7',\n   [[['s4', 'PHYS110', 0, False], ['s1', 'BIO130', 1, False], ['s1', 'MATH101H', 0, False],\n     ['s5', 'BIO130', 0, False], ['s4', 'CHEM120', 2, False], ['s4', 'CHEM120', 2, False]],\n    {0: 3, 1: 1, 2: 4},\n    {'MATH101': 'online', 'MATH101H': 'online', 'PHYS110': 'paper', 'CHEM120': 'paper', 'BIO130': 'paper'}],\n   []),\n  ('normal control 8',\n   [[['s2', 'MATH101', 2, False], ['s4', 'BIO130', 1, True], ['s4', 'CHEM120', 0, True],\n     ['s2', 'MATH101', 2, False], ['s4', 'MATH101H', 0, False], ['s5', 'CHEM120', 2, False],\n     ['s4', 'MATH101H', 0, False], ['s5', 'CHEM120', 1, False]],\n    {0: 2, 1: 4, 2: 3}, {'MATH101H': 'online', 'PHYS110': 'paper', 'BIO130': 'online'}],\n   [])],\n [('regression: duplicate sitting rows 1',\n   [[['s1', 'BIO130', 0, False], ['s1', 'PHYS110', 0, True], ['s5', 'CHEM120', 1, False],\n     ['s1', 'BIO130', 0, False], ['s2', 'CHEM120', 2, False], ['s1', 'BIO130', 0, False]],\n    {0: 3, 1: 4, 2: 2},\n    {'MATH101': 'paper', 'MATH101H': 'paper', 'PHYS110': 'paper', 'CHEM120': 'paper', 'BIO130': 'paper'}],\n   []),\n  ('regression variant: duplicate sitting rows 2',\n   [[['s3', 'BIO130', 2, False], ['s4', 'MATH101', 2, True], ['s4', 'MATH101H', 0, True],\n     ['s2', 'PHYS110', 2, False], ['s4', 'MATH101', 2, False], ['s5', 'PHYS110', 1, False],\n     ['s2', 'PHYS110', 2, False]],\n    {0: 2, 1: 2},\n    {'MATH101': 'paper', 'MATH101H': 'online', 'PHYS110': 'online', 'CHEM120': 'online', 'BIO130': 'paper'}],\n   [[2, 3, 0]]),\n  ('partial repair guard 3',\n   [[['s1', 'MATH101', 0, False], ['s3', 'MATH101H', 1, False], ['s2', 'CHEM120', 1, False],\n     ['s3', 'MATH101H', 2, False], ['s3', 'MATH101', 1, False], ['s1', 'MATH101H', 2, True],\n     ['s5', 'PHYS110', 0, False], ['s5', 'CHEM120', 2, False], ['s2', 'MATH101', 2, False],\n     ['s2', 'PHYS110', 0, False], ['s5', 'PHYS110', 0, False]],\n    {0: 2, 2: 1}, {'MATH101': 'paper', 'MATH101H': 'paper', 'PHYS110': 'online'}],\n   [[1, 3, 0], [2, 4, 1]]),\n  ('boundary control 4', [[['s1', 'A', 0, False], ['s1', 'B', 0, False]], {0: 1}, {}], [[0, 2, 1]]),\n  ('boundary control 5', [[['s1', 'A', 0, False], ['s1', 'A', 0, False]], {0: 1}, {'A': 'paper'}], []),\n  ('normal control 6',\n   [[['s4', 'BIO130', 2, False], ['s3', 'BIO130', 2, True], ['s4', 'BIO130', 2, False]], {0: 4, 1: 3, 2: 4},\n    {'MATH101': 'paper', 'MATH101H': 'online', 'PHYS110': 'paper', 'CHEM120': 'online', 'BIO130': 'paper'}],\n   []),\n  ('normal control 7',\n   [[['s5', 'PHYS110', 2, False], ['s4', 'MATH101', 0, False], ['s5', 'MATH101H', 2, True],\n     ['s2', 'CHEM120', 2, False], ['s1', 'BIO130', 0, False], ['s2', 'BIO130', 0, False],\n     ['s2', 'PHYS110', 2, True], ['s1', 'CHEM120', 1, False], ['s1', 'CHEM120', 1, False],\n     ['s4', 'BIO130', 0, False]],\n    {0: 4, 1: 2, 2: 3},\n    {'MATH101': 'paper', 'MATH101H': 'paper', 'PHYS110': 'paper', 'CHEM120': 'paper', 'BIO130': 'paper'}],\n   [[2, 6, 3]]),\n  ('normal control 8',\n   [[['s2', 'PHYS110', 2, False], ['s4', 'CHEM120', 0, True], ['s2', 'PHYS110', 0, True]], {1: 3, 2: 3},\n    {'MATH101H': 'paper', 'PHYS110': 'paper', 'CHEM120': 'paper'}],\n   [[0, 2, 0]])]]\nfor label, args, expected in fixtures[N-1]:\n    check(label, solve(*args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"}},"limitations":"Stipulated toy exam-timetabling rule set for a bounded model; it does not claim conformance with any institution's regulations or a benchmark specification, and it performs no search or optimisation. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.","method":"Deterministic executable model with adversarial boundary fixtures.","provenance":{"created_by":"Failure Map","dependencies":"Python standard library","family":"w2-exam-timetabling-constraints-period-seat-capacity-duplicate-sitting-rows","generated_at":"2026-09-29T14:52:06.820907+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Seat capacity per period is a hard constraint on which periods can take large exams.","repair":"Count each (student, exam) once.","root_cause":"Rows are not deduplicated by student and exam.","sha256":"10d702b7a2781ced94ea841bf74c7222d888d0b659a78d0452da3323d497cb0b","title":"Repeated sitting rows consume extra seats · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":44.878,"exit_code":1,"observations":[{"actual":[],"check":"regression: duplicate sitting rows 1","expected":[],"passed":true},{"actual":[],"check":"regression variant: duplicate sitting rows 2","expected":[],"passed":true},{"actual":[[1,2,1]],"check":"partial repair guard 3","expected":[[1,3,1]],"passed":false},{"actual":[],"check":"boundary control 4","expected":[[0,2,1]],"passed":false},{"actual":[[0,4,3]],"check":"normal control 5","expected":[],"passed":false},{"actual":[[1,2,1]],"check":"normal control 6","expected":[[1,2,1]],"passed":true},{"actual":[],"check":"normal control 7","expected":[[2,4,2]],"passed":false},{"actual":[],"check":"normal control 8","expected":[],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: duplicate sitting rows 1\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"regression variant: duplicate sitting rows 2\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"partial repair guard 3\", \"actual\": [[1, 2, 1]], \"expected\": [[1, 3, 1]], \"passed\": false}, {\"check\": \"boundary control 4\", \"actual\": [], \"expected\": [[0, 2, 1]], \"passed\": false}, {\"check\": \"normal control 5\", \"actual\": [[0, 4, 3]], \"expected\": [], \"passed\": false}, {\"check\": \"normal control 6\", \"actual\": [[1, 2, 1]], \"expected\": [[1, 2, 1]], \"passed\": true}, {\"check\": \"normal control 7\", \"actual\": [], \"expected\": [[2, 4, 2]], \"passed\": false}, {\"check\": \"normal control 8\", \"actual\": [], \"expected\": [], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":40.309,"exit_code":1,"observations":[{"actual":[[0,2,1]],"check":"regression: duplicate sitting rows 1","expected":[],"passed":false},{"actual":[[2,4,3]],"check":"regression variant: duplicate sitting rows 2","expected":[],"passed":false},{"actual":[[1,3,1]],"check":"partial repair guard 3","expected":[[1,3,1]],"passed":true},{"actual":[[0,2,1]],"check":"boundary control 4","expected":[[0,2,1]],"passed":true},{"actual":[[0,5,3]],"check":"normal control 5","expected":[],"passed":false},{"actual":[[1,2,1]],"check":"normal control 6","expected":[[1,2,1]],"passed":true},{"actual":[[2,4,2]],"check":"normal control 7","expected":[[2,4,2]],"passed":true},{"actual":[],"check":"normal control 8","expected":[],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: duplicate sitting rows 1\", \"actual\": [[0, 2, 1]], \"expected\": [], \"passed\": false}, {\"check\": \"regression variant: duplicate sitting rows 2\", \"actual\": [[2, 4, 3]], \"expected\": [], \"passed\": false}, {\"check\": \"partial repair guard 3\", \"actual\": [[1, 3, 1]], \"expected\": [[1, 3, 1]], \"passed\": true}, {\"check\": \"boundary control 4\", \"actual\": [[0, 2, 1]], \"expected\": [[0, 2, 1]], \"passed\": true}, {\"check\": \"normal control 5\", \"actual\": [[0, 5, 3]], \"expected\": [], \"passed\": false}, {\"check\": \"normal control 6\", \"actual\": [[1, 2, 1]], \"expected\": [[1, 2, 1]], \"passed\": true}, {\"check\": \"normal control 7\", \"actual\": [[2, 4, 2]], \"expected\": [[2, 4, 2]], \"passed\": true}, {\"check\": \"normal control 8\", \"actual\": [], \"expected\": [], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":41.899,"exit_code":0,"observations":[{"actual":[],"check":"regression: duplicate sitting rows 1","expected":[],"passed":true},{"actual":[],"check":"regression variant: duplicate sitting rows 2","expected":[],"passed":true},{"actual":[[1,3,1]],"check":"partial repair guard 3","expected":[[1,3,1]],"passed":true},{"actual":[[0,2,1]],"check":"boundary control 4","expected":[[0,2,1]],"passed":true},{"actual":[],"check":"normal control 5","expected":[],"passed":true},{"actual":[[1,2,1]],"check":"normal control 6","expected":[[1,2,1]],"passed":true},{"actual":[[2,4,2]],"check":"normal control 7","expected":[[2,4,2]],"passed":true},{"actual":[],"check":"normal control 8","expected":[],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: duplicate sitting rows 1\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"regression variant: duplicate sitting rows 2\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"partial repair guard 3\", \"actual\": [[1, 3, 1]], \"expected\": [[1, 3, 1]], \"passed\": true}, {\"check\": \"boundary control 4\", \"actual\": [[0, 2, 1]], \"expected\": [[0, 2, 1]], \"passed\": true}, {\"check\": \"normal control 5\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"normal control 6\", \"actual\": [[1, 2, 1]], \"expected\": [[1, 2, 1]], \"passed\": true}, {\"check\": \"normal control 7\", \"actual\": [[2, 4, 2]], \"expected\": [[2, 4, 2]], \"passed\": true}, {\"check\": \"normal control 8\", \"actual\": [], \"expected\": [], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}