FA-85061 / Fantasy sports scoring / Open access
Lineup spending exactly the cap rejected · case 01
A lineup using every dollar of the cap is refused as over budget.
ROOT CAUSE
The cap test uses >=, rejecting salary equal to the cap.
THE FAILURE
The cap test uses >=, rejecting salary equal to the cap.
Unsuccessful approach: Comparing with the unmultiplied captain salary accepts lineups that are over the cap.
Case contract
A single-game lineup has one captain and five flex players. The captain costs 1.5x salary rounded up to the next 100 and scores 1.5x points (hundredths, rounded half away from zero). Validation order: exactly five flex players and six distinct names (roster), salary total at most the cap (cap), players from at least two teams (teams). Return validity, first failing reason, salary and points.
Why this case matters
Captain multipliers on both salary and points are where showdown contest lineups are mispriced or wrongly rejected.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(lineup, points, salaries, teams, cap):
cpt, flex = lineup['CPT'], lineup['FLEX']
names = [cpt] + flex
cpt_salary = -(-salaries[cpt] * 3 // 200) * 100
salary = cpt_salary + sum(salaries[p] for p in flex)
c = points[cpt] * 3
cpt_pts = (abs(c) + 1) // 2 * (1 if c >= 0 else -1)
total = cpt_pts + sum(points[p] for p in flex)
if len(flex) != 5 or len(set(names)) != 6:
return {'valid': False, 'reason': 'roster', 'salary': salary, 'points': total}
if salary >= cap:
return {'valid': False, 'reason': 'cap', 'salary': salary, 'points': total}
if len({teams[p] for p in names}) < 2:
return {'valid': False, 'reason': 'teams', 'salary': salary, 'points': total}
return {'valid': True, 'reason': None, 'salary': salary, 'points': total}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: salary cap boundary',
[{'CPT': 'f', 'FLEX': ['h', 'e', 'a', 'c', 'd']},
{'a': 1791, 'b': 12, 'c': 2001, 'd': 225, 'e': 1833, 'f': -45, 'g': -45, 'h': 225},
{'a': 9900, 'b': 3300, 'c': 8700, 'd': 9900, 'e': 8700, 'f': 7100, 'g': 5300, 'h': 5500},
{'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'A', 'g': 'H', 'h': 'H'}, 53400],
{'points': 6007, 'reason': None, 'salary': 53400, 'valid': True}),
('partial repair probe: salary cap boundary',
[{'CPT': 'e', 'FLEX': ['c', 'd', 'f', 'g', 'h']},
{'a': -45, 'b': 2001, 'c': 2001, 'd': 1795, 'e': 0, 'f': 2763, 'g': 225, 'h': 1566},
{'a': 9900, 'b': 7100, 'c': 8700, 'd': 7100, 'e': 9900, 'f': 5500, 'g': 10500, 'h': 7100},
{'a': 'H', 'b': 'H', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 50000],
{'points': 8350, 'reason': 'cap', 'salary': 53800, 'valid': False}),
('second regression',
[{'CPT': 'f', 'FLEX': ['c', 'a', 'd', 'g', 'b']},
{'a': 1795, 'b': 225, 'c': -50, 'd': 1333, 'e': 0, 'f': 2256, 'g': 1333, 'h': 2001},
{'a': 8700, 'b': 9900, 'c': 9900, 'd': 9900, 'e': 5500, 'f': 10500, 'g': 5300, 'h': 3300},
{'a': 'H', 'b': 'A', 'c': 'A', 'd': 'A', 'e': 'H', 'f': 'A', 'g': 'H', 'h': 'A'}, 59500],
{'points': 8020, 'reason': None, 'salary': 59500, 'valid': True}),
('normal control 1',
[{'CPT': 'f', 'FLEX': ['d', 'a', 'f', 'b', 'e']},
{'a': 1795, 'b': 1795, 'c': -50, 'd': 2001, 'e': 0, 'f': -50, 'g': -50, 'h': -45},
{'a': 3300, 'b': 8700, 'c': 8700, 'd': 8700, 'e': 8700, 'f': 5500, 'g': 5500, 'h': 3300},
{'a': 'A', 'b': 'A', 'c': 'A', 'd': 'H', 'e': 'A', 'f': 'A', 'g': 'H', 'h': 'H'}, 50000],
{'points': 5466, 'reason': 'roster', 'salary': 43200, 'valid': False}),
('normal control 2',
[{'CPT': 'c', 'FLEX': ['b', 'f', 'e', 'a', 'h']},
{'a': 1795, 'b': 2001, 'c': 225, 'd': -45, 'e': 2001, 'f': -45, 'g': 225, 'h': 225},
{'a': 9900, 'b': 10500, 'c': 5300, 'd': 5500, 'e': 8700, 'f': 5300, 'g': 5300, 'h': 8700},
{'a': 'A', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 51200],
{'points': 6315, 'reason': None, 'salary': 51100, 'valid': True}),
('normal control 3',
[{'CPT': 'h', 'FLEX': ['g', 'h', 'b', 'a', 'h']},
{'a': 0, 'b': -50, 'c': -50, 'd': 2590, 'e': 225, 'f': 176, 'g': 225, 'h': 0},
{'a': 3300, 'b': 9900, 'c': 3300, 'd': 8700, 'e': 5300, 'f': 3300, 'g': 9900, 'h': 7100},
{'a': 'H', 'b': 'H', 'c': 'A', 'd': 'A', 'e': 'H', 'f': 'H', 'g': 'A', 'h': 'A'}, 48100],
{'points': 175, 'reason': 'roster', 'salary': 48000, 'valid': False}),
('normal control 4',
[{'CPT': 'd', 'FLEX': ['e', 'a', 'b', 'c', 'g']},
{'a': 2001, 'b': 1333, 'c': -45, 'd': 225, 'e': -50, 'f': 1333, 'g': -45, 'h': 0},
{'a': 9900, 'b': 10500, 'c': 8700, 'd': 7100, 'e': 3300, 'f': 5300, 'g': 5500, 'h': 3300},
{'a': 'A', 'b': 'A', 'c': 'H', 'd': 'A', 'e': 'H', 'f': 'H', 'g': 'A', 'h': 'H'}, 50000],
{'points': 3532, 'reason': None, 'salary': 48600, 'valid': True})],
[('regression: salary cap boundary',
[{'CPT': 'g', 'FLEX': ['f', 'e', 'a', 'c', 'd']},
{'a': 1795, 'b': 628, 'c': 2001, 'd': -50, 'e': 1333, 'f': 1333, 'g': -45, 'h': 2835},
{'a': 5300, 'b': 7100, 'c': 10500, 'd': 9900, 'e': 5300, 'f': 5500, 'g': 8700, 'h': 5300},
{'a': 'A', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 49600],
{'points': 6344, 'reason': None, 'salary': 49600, 'valid': True}),
('partial repair probe: salary cap boundary',
[{'CPT': 'g', 'FLEX': ['e', 'c', 'b', 'd', 'a']},
{'a': 2241, 'b': 1664, 'c': 2001, 'd': 225, 'e': 1795, 'f': 2184, 'g': 225, 'h': 225},
{'a': 5300, 'b': 9900, 'c': 8700, 'd': 8700, 'e': 5300, 'f': 5500, 'g': 8700, 'h': 7100},
{'a': 'H', 'b': 'A', 'c': 'A', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'A', 'h': 'H'}, 50000],
{'points': 8264, 'reason': 'cap', 'salary': 51000, 'valid': False}),
('second regression',
[{'CPT': 'c', 'FLEX': ['f', 'h', 'd', 'e', 'g']},
{'a': 0, 'b': 2001, 'c': 0, 'd': -50, 'e': 1333, 'f': -45, 'g': 1795, 'h': 2001},
{'a': 8700, 'b': 10500, 'c': 5500, 'd': 8700, 'e': 5500, 'f': 7100, 'g': 10500, 'h': 7100},
{'a': 'A', 'b': 'A', 'c': 'A', 'd': 'A', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'H'}, 47100],
{'points': 5034, 'reason': 'cap', 'salary': 47200, 'valid': False}),
('normal control 1',
[{'CPT': 'b', 'FLEX': ['d', 'f', 'b', 'h', 'g']},
{'a': 225, 'b': 2001, 'c': 2001, 'd': 1333, 'e': -50, 'f': 0, 'g': 2001, 'h': 1333},
{'a': 9900, 'b': 9900, 'c': 3300, 'd': 3300, 'e': 5500, 'f': 3300, 'g': 8700, 'h': 5300},
{'a': 'H', 'b': 'A', 'c': 'H', 'd': 'A', 'e': 'A', 'f': 'H', 'g': 'A', 'h': 'A'}, 50000],
{'points': 9670, 'reason': 'roster', 'salary': 45400, 'valid': False}),
('normal control 2',
[{'CPT': 'd', 'FLEX': ['f', 'a', 'c', 'd', 'b']},
{'a': -45, 'b': -45, 'c': 0, 'd': -50, 'e': -94, 'f': 2001, 'g': 225, 'h': -50},
{'a': 7100, 'b': 5300, 'c': 3300, 'd': 3300, 'e': 3300, 'f': 7100, 'g': 5300, 'h': 10500},
{'a': 'A', 'b': 'H', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'A'}, 31000],
{'points': 1786, 'reason': 'roster', 'salary': 31100, 'valid': False}),
('normal control 3',
[{'CPT': 'e', 'FLEX': ['g', 'a', 'e', 'c', 'h']},
{'a': -45, 'b': -50, 'c': 225, 'd': -50, 'e': 0, 'f': -50, 'g': 0, 'h': 0},
{'a': 5300, 'b': 9900, 'c': 5500, 'd': 10500, 'e': 10500, 'f': 10500, 'g': 10500, 'h': 5300},
{'a': 'H', 'b': 'H', 'c': 'H', 'd': 'A', 'e': 'A', 'f': 'A', 'g': 'H', 'h': 'A'}, 50000],
{'points': 180, 'reason': 'roster', 'salary': 52900, 'valid': False}),
('normal control 4',
[{'CPT': 'f', 'FLEX': ['e', 'c', 'f', 'd', 'b']},
{'a': -45, 'b': 532, 'c': 0, 'd': 2001, 'e': 0, 'f': -50, 'g': 1385, 'h': -50},
{'a': 9900, 'b': 5500, 'c': 8700, 'd': 3300, 'e': 7100, 'f': 9900, 'g': 8700, 'h': 9900},
{'a': 'A', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'A'}, 49400],
{'points': 2408, 'reason': 'roster', 'salary': 49400, 'valid': False})],
[('regression: salary cap boundary',
[{'CPT': 'h', 'FLEX': ['c', 'd', 'a', 'e', 'f']},
{'a': 225, 'b': 225, 'c': 225, 'd': 2690, 'e': 0, 'f': 1333, 'g': 332, 'h': 1333},
{'a': 5300, 'b': 3300, 'c': 9900, 'd': 8700, 'e': 8700, 'f': 9900, 'g': 9900, 'h': 8700},
{'a': 'A', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'A', 'h': 'A'}, 55600],
{'points': 6473, 'reason': None, 'salary': 55600, 'valid': True}),
('partial repair probe: salary cap boundary',
[{'CPT': 'b', 'FLEX': ['c', 'a', 'g', 'e', 'h']},
{'a': -45, 'b': -45, 'c': -50, 'd': -45, 'e': 325, 'f': 225, 'g': 1333, 'h': 2279},
{'a': 9900, 'b': 8700, 'c': 5300, 'd': 5500, 'e': 10500, 'f': 3300, 'g': 7100, 'h': 5500},
{'a': 'A', 'b': 'A', 'c': 'A', 'd': 'H', 'e': 'A', 'f': 'A', 'g': 'H', 'h': 'A'}, 51300],
{'points': 3774, 'reason': 'cap', 'salary': 51400, 'valid': False}),
('second regression',
[{'CPT': 'h', 'FLEX': ['a', 'g', 'd', 'f', 'b']},
{'a': -50, 'b': 1333, 'c': 1795, 'd': -50, 'e': -50, 'f': 0, 'g': 741, 'h': -50},
{'a': 9900, 'b': 9900, 'c': 8700, 'd': 3300, 'e': 3300, 'f': 7100, 'g': 9900, 'h': 5500},
{'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'A'}, 48300],
{'points': 1899, 'reason': 'cap', 'salary': 48400, 'valid': False}),
('normal control 1',
[{'CPT': 'h', 'FLEX': ['f', 'c', 'h', 'b']},
{'a': 2001, 'b': 2001, 'c': -45, 'd': 439, 'e': 2001, 'f': 1333, 'g': 225, 'h': 0},
{'a': 10500, 'b': 9900, 'c': 9900, 'd': 3300, 'e': 9900, 'f': 8700, 'g': 5500, 'h': 5300},
{'a': 'A', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'A', 'g': 'H', 'h': 'H'}, 41900],
{'points': 3289, 'reason': 'roster', 'salary': 41800, 'valid': False}),
('normal control 2',
[{'CPT': 'h', 'FLEX': ['c', 'd', 'h', 'f']},
{'a': 2001, 'b': 1333, 'c': 1795, 'd': 1795, 'e': 0, 'f': 2915, 'g': 2001, 'h': -45},
{'a': 3300, 'b': 10500, 'c': 5300, 'd': 10500, 'e': 5500, 'f': 10500, 'g': 7100, 'h': 9900},
{'a': 'A', 'b': 'A', 'c': 'A', 'd': 'A', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 51000],
{'points': 6392, 'reason': 'roster', 'salary': 51100, 'valid': False}),
('normal control 3',
[{'CPT': 'c', 'FLEX': ['a', 'h', 'f', 'd', 'g']},
{'a': 2001, 'b': -45, 'c': 1333, 'd': 2807, 'e': 0, 'f': 1333, 'g': -45, 'h': 1333},
{'a': 10500, 'b': 3300, 'c': 10500, 'd': 5500, 'e': 5300, 'f': 10500, 'g': 8700, 'h': 5500},
{'a': 'H', 'b': 'H', 'c': 'H', 'd': 'A', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 50000],
{'points': 9429, 'reason': 'cap', 'salary': 56500, 'valid': False}),
('normal control 4',
[{'CPT': 'c', 'FLEX': ['h', 'f', 'g', 'c', 'e']},
{'a': 1333, 'b': -45, 'c': -50, 'd': -45, 'e': 1333, 'f': -45, 'g': 1795, 'h': -50},
{'a': 5500, 'b': 5500, 'c': 10500, 'd': 9900, 'e': 5300, 'f': 7100, 'g': 3300, 'h': 10500},
{'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'A'}, 52400],
{'points': 2908, 'reason': 'roster', 'salary': 52500, 'valid': False})],
[('regression: salary cap boundary',
[{'CPT': 'h', 'FLEX': ['a', 'c', 'e', 'd', 'f']},
{'a': 2001, 'b': -45, 'c': 225, 'd': 225, 'e': 1580, 'f': -50, 'g': -45, 'h': 0},
{'a': 3300, 'b': 7100, 'c': 8700, 'd': 8700, 'e': 10500, 'f': 5500, 'g': 5300, 'h': 5500},
{'a': 'H', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 45000],
{'points': 3981, 'reason': 'teams', 'salary': 45000, 'valid': False}),
('partial repair probe: salary cap boundary',
[{'CPT': 'b', 'FLEX': ['g', 'e', 'f', 'c', 'a']},
{'a': 1333, 'b': -50, 'c': 225, 'd': 1333, 'e': 1333, 'f': 225, 'g': 1795, 'h': 1795},
{'a': 10500, 'b': 5500, 'c': 5300, 'd': 8700, 'e': 8700, 'f': 10500, 'g': 7100, 'h': 3300},
{'a': 'A', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 50000],
{'points': 4836, 'reason': 'cap', 'salary': 50400, 'valid': False}),
('second regression',
[{'CPT': 'c', 'FLEX': ['h', 'f', 'd', 'g', 'a']},
{'a': -45, 'b': -45, 'c': 1333, 'd': 2001, 'e': 0, 'f': 225, 'g': -45, 'h': 2001},
{'a': 10500, 'b': 7100, 'c': 5500, 'd': 5500, 'e': 7100, 'f': 7100, 'g': 7100, 'h': 5300},
{'a': 'H', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'A', 'h': 'H'}, 43700],
{'points': 6137, 'reason': 'cap', 'salary': 43800, 'valid': False}),
('normal control 1',
[{'CPT': 'g', 'FLEX': ['b', 'a', 'g', 'e', 'd']},
{'a': 1333, 'b': -50, 'c': 0, 'd': 1551, 'e': 2001, 'f': 2001, 'g': -50, 'h': 1030},
{'a': 10500, 'b': 9900, 'c': 5300, 'd': 5300, 'e': 8700, 'f': 5500, 'g': 10500, 'h': 5300},
{'a': 'H', 'b': 'A', 'c': 'A', 'd': 'A', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'A'}, 60600],
{'points': 4710, 'reason': 'roster', 'salary': 60700, 'valid': False}),
('normal control 2',
[{'CPT': 'f', 'FLEX': ['h', 'f', 'e', 'a', 'c']},
{'a': 169, 'b': 2001, 'c': 0, 'd': 1333, 'e': -45, 'f': 2001, 'g': 2001, 'h': -45},
{'a': 5500, 'b': 5300, 'c': 7100, 'd': 8700, 'e': 8700, 'f': 3300, 'g': 8700, 'h': 5300},
{'a': 'H', 'b': 'A', 'c': 'A', 'd': 'A', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'A'}, 50000],
{'points': 5082, 'reason': 'roster', 'salary': 34900, 'valid': False}),
('normal control 3',
[{'CPT': 'e', 'FLEX': ['d', 'g', 'a', 'h']},
{'a': 0, 'b': 1020, 'c': 2001, 'd': 0, 'e': 2001, 'f': -45, 'g': -50, 'h': 225},
{'a': 7100, 'b': 9900, 'c': 5500, 'd': 8700, 'e': 5500, 'f': 7100, 'g': 5300, 'h': 8700},
{'a': 'A', 'b': 'A', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'A', 'h': 'H'}, 50000],
{'points': 3177, 'reason': 'roster', 'salary': 38100, 'valid': False}),
('normal control 4',
[{'CPT': 'd', 'FLEX': ['h', 'a', 'c', 'g', 'b']},
{'a': 225, 'b': 2001, 'c': 1333, 'd': 0, 'e': -45, 'f': 2498, 'g': 1795, 'h': 225},
{'a': 7100, 'b': 8700, 'c': 3300, 'd': 10500, 'e': 5300, 'f': 10500, 'g': 5300, 'h': 7100},
{'a': 'H', 'b': 'H', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 47400],
{'points': 5579, 'reason': None, 'salary': 47300, 'valid': True})],
[('regression: salary cap boundary',
[{'CPT': 'a', 'FLEX': ['g', 'e', 'd', 'c', 'h']},
{'a': 0, 'b': -50, 'c': 1108, 'd': 225, 'e': 2524, 'f': 1333, 'g': 1795, 'h': -45},
{'a': 10500, 'b': 5300, 'c': 5300, 'd': 10500, 'e': 5500, 'f': 7100, 'g': 3300, 'h': 5300},
{'a': 'A', 'b': 'A', 'c': 'H', 'd': 'A', 'e': 'A', 'f': 'A', 'g': 'H', 'h': 'A'}, 45700],
{'points': 5607, 'reason': None, 'salary': 45700, 'valid': True}),
('partial repair probe: salary cap boundary',
[{'CPT': 'a', 'FLEX': ['h', 'g', 'b', 'e', 'd']},
{'a': 2105, 'b': 1333, 'c': 1333, 'd': 1333, 'e': -45, 'f': -40, 'g': 1795, 'h': 2051},
{'a': 5300, 'b': 7100, 'c': 7100, 'd': 8700, 'e': 7100, 'f': 7100, 'g': 10500, 'h': 5500},
{'a': 'A', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'A', 'h': 'H'}, 46800],
{'points': 9625, 'reason': 'cap', 'salary': 46900, 'valid': False}),
('second regression',
[{'CPT': 'b', 'FLEX': ['g', 'f', 'c', 'h', 'd']},
{'a': -45, 'b': -45, 'c': -45, 'd': 225, 'e': 1333, 'f': 0, 'g': 1333, 'h': 376},
{'a': 5500, 'b': 7100, 'c': 9900, 'd': 10500, 'e': 7100, 'f': 9900, 'g': 9900, 'h': 3300},
{'a': 'H', 'b': 'H', 'c': 'A', 'd': 'A', 'e': 'A', 'f': 'H', 'g': 'A', 'h': 'H'}, 54200],
{'points': 1821, 'reason': None, 'salary': 54200, 'valid': True}),
('normal control 1',
[{'CPT': 'c', 'FLEX': ['f', 'h', 'b', 'c', 'e']},
{'a': 1795, 'b': 225, 'c': -45, 'd': 0, 'e': 2001, 'f': 225, 'g': 225, 'h': 1745},
{'a': 8700, 'b': 3300, 'c': 5300, 'd': 3300, 'e': 3300, 'f': 5500, 'g': 3300, 'h': 7100},
{'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'A'}, 32600],
{'points': 4083, 'reason': 'roster', 'salary': 32500, 'valid': False}),
('normal control 2',
[{'CPT': 'c', 'FLEX': ['h', 'b', 'a', 'd', 'c']},
{'a': 0, 'b': 0, 'c': -45, 'd': 225, 'e': -50, 'f': 2001, 'g': 1795, 'h': 225},
{'a': 3300, 'b': 3300, 'c': 7100, 'd': 3300, 'e': 9900, 'f': 3300, 'g': 7100, 'h': 7100},
{'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'A'}, 34900],
{'points': 337, 'reason': 'roster', 'salary': 34800, 'valid': False}),
('normal control 3',
[{'CPT': 'h', 'FLEX': ['e', 'b', 'f', 'h']},
{'a': 225, 'b': 940, 'c': 769, 'd': 0, 'e': -50, 'f': 1795, 'g': -45, 'h': 1333},
{'a': 5500, 'b': 8700, 'c': 10500, 'd': 5500, 'e': 10500, 'f': 10500, 'g': 3300, 'h': 3300},
{'a': 'H', 'b': 'H', 'c': 'A', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'A', 'h': 'H'}, 38000],
{'points': 6018, 'reason': 'roster', 'salary': 38000, 'valid': False}),
('normal control 4',
[{'CPT': 'f', 'FLEX': ['c', 'h', 'd', 'e', 'f']},
{'a': 0, 'b': 1681, 'c': -45, 'd': 0, 'e': 1333, 'f': 2001, 'g': -50, 'h': 0},
{'a': 3300, 'b': 3300, 'c': 9900, 'd': 9900, 'e': 5300, 'f': 9900, 'g': 3300, 'h': 7100},
{'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'A', 'h': 'H'}, 50000],
{'points': 6291, 'reason': 'roster', 'salary': 57000, 'valid': False})]]
for label, args, expected in fixtures[N-1]:
check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression: salary cap boundary | {'points': 6007, 'reason': 'cap', 'salary': 53400, 'valid': False} | {'points': 6007, 'reason': None, 'salary': 53400, 'valid': True} | Failed |
| partial repair probe: salary cap boundary | {'points': 8350, 'reason': 'cap', 'salary': 53800, 'valid': False} | {'points': 8350, 'reason': 'cap', 'salary': 53800, 'valid': False} | Passed |
| second regression | {'points': 8020, 'reason': 'cap', 'salary': 59500, 'valid': False} | {'points': 8020, 'reason': None, 'salary': 59500, 'valid': True} | Failed |
| normal control 1 | {'points': 5466, 'reason': 'roster', 'salary': 43200, 'valid': False} | {'points': 5466, 'reason': 'roster', 'salary': 43200, 'valid': False} | Passed |
| normal control 2 | {'points': 6315, 'reason': None, 'salary': 51100, 'valid': True} | {'points': 6315, 'reason': None, 'salary': 51100, 'valid': True} | Passed |
| normal control 3 | {'points': 175, 'reason': 'roster', 'salary': 48000, 'valid': False} | {'points': 175, 'reason': 'roster', 'salary': 48000, 'valid': False} | Passed |
| normal control 4 | {'points': 3532, 'reason': None, 'salary': 48600, 'valid': True} | {'points': 3532, 'reason': None, 'salary': 48600, 'valid': True} | Passed |
SHA-256 / e26fb0ce9934fd6dd193e56277324753938729f8e8baf2e39226ccb4fb5dec41
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(lineup, points, salaries, teams, cap):
cpt, flex = lineup['CPT'], lineup['FLEX']
names = [cpt] + flex
cpt_salary = -(-salaries[cpt] * 3 // 200) * 100
salary = cpt_salary + sum(salaries[p] for p in flex)
c = points[cpt] * 3
cpt_pts = (abs(c) + 1) // 2 * (1 if c >= 0 else -1)
total = cpt_pts + sum(points[p] for p in flex)
if len(flex) != 5 or len(set(names)) != 6:
return {'valid': False, 'reason': 'roster', 'salary': salary, 'points': total}
if salary - cpt_salary + salaries[cpt] > cap:
return {'valid': False, 'reason': 'cap', 'salary': salary, 'points': total}
if len({teams[p] for p in names}) < 2:
return {'valid': False, 'reason': 'teams', 'salary': salary, 'points': total}
return {'valid': True, 'reason': None, 'salary': salary, 'points': total}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: salary cap boundary',
[{'CPT': 'f', 'FLEX': ['h', 'e', 'a', 'c', 'd']},
{'a': 1791, 'b': 12, 'c': 2001, 'd': 225, 'e': 1833, 'f': -45, 'g': -45, 'h': 225},
{'a': 9900, 'b': 3300, 'c': 8700, 'd': 9900, 'e': 8700, 'f': 7100, 'g': 5300, 'h': 5500},
{'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'A', 'g': 'H', 'h': 'H'}, 53400],
{'points': 6007, 'reason': None, 'salary': 53400, 'valid': True}),
('partial repair probe: salary cap boundary',
[{'CPT': 'e', 'FLEX': ['c', 'd', 'f', 'g', 'h']},
{'a': -45, 'b': 2001, 'c': 2001, 'd': 1795, 'e': 0, 'f': 2763, 'g': 225, 'h': 1566},
{'a': 9900, 'b': 7100, 'c': 8700, 'd': 7100, 'e': 9900, 'f': 5500, 'g': 10500, 'h': 7100},
{'a': 'H', 'b': 'H', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 50000],
{'points': 8350, 'reason': 'cap', 'salary': 53800, 'valid': False}),
('second regression',
[{'CPT': 'f', 'FLEX': ['c', 'a', 'd', 'g', 'b']},
{'a': 1795, 'b': 225, 'c': -50, 'd': 1333, 'e': 0, 'f': 2256, 'g': 1333, 'h': 2001},
{'a': 8700, 'b': 9900, 'c': 9900, 'd': 9900, 'e': 5500, 'f': 10500, 'g': 5300, 'h': 3300},
{'a': 'H', 'b': 'A', 'c': 'A', 'd': 'A', 'e': 'H', 'f': 'A', 'g': 'H', 'h': 'A'}, 59500],
{'points': 8020, 'reason': None, 'salary': 59500, 'valid': True}),
('normal control 1',
[{'CPT': 'f', 'FLEX': ['d', 'a', 'f', 'b', 'e']},
{'a': 1795, 'b': 1795, 'c': -50, 'd': 2001, 'e': 0, 'f': -50, 'g': -50, 'h': -45},
{'a': 3300, 'b': 8700, 'c': 8700, 'd': 8700, 'e': 8700, 'f': 5500, 'g': 5500, 'h': 3300},
{'a': 'A', 'b': 'A', 'c': 'A', 'd': 'H', 'e': 'A', 'f': 'A', 'g': 'H', 'h': 'H'}, 50000],
{'points': 5466, 'reason': 'roster', 'salary': 43200, 'valid': False}),
('normal control 2',
[{'CPT': 'c', 'FLEX': ['b', 'f', 'e', 'a', 'h']},
{'a': 1795, 'b': 2001, 'c': 225, 'd': -45, 'e': 2001, 'f': -45, 'g': 225, 'h': 225},
{'a': 9900, 'b': 10500, 'c': 5300, 'd': 5500, 'e': 8700, 'f': 5300, 'g': 5300, 'h': 8700},
{'a': 'A', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 51200],
{'points': 6315, 'reason': None, 'salary': 51100, 'valid': True}),
('normal control 3',
[{'CPT': 'h', 'FLEX': ['g', 'h', 'b', 'a', 'h']},
{'a': 0, 'b': -50, 'c': -50, 'd': 2590, 'e': 225, 'f': 176, 'g': 225, 'h': 0},
{'a': 3300, 'b': 9900, 'c': 3300, 'd': 8700, 'e': 5300, 'f': 3300, 'g': 9900, 'h': 7100},
{'a': 'H', 'b': 'H', 'c': 'A', 'd': 'A', 'e': 'H', 'f': 'H', 'g': 'A', 'h': 'A'}, 48100],
{'points': 175, 'reason': 'roster', 'salary': 48000, 'valid': False}),
('normal control 4',
[{'CPT': 'd', 'FLEX': ['e', 'a', 'b', 'c', 'g']},
{'a': 2001, 'b': 1333, 'c': -45, 'd': 225, 'e': -50, 'f': 1333, 'g': -45, 'h': 0},
{'a': 9900, 'b': 10500, 'c': 8700, 'd': 7100, 'e': 3300, 'f': 5300, 'g': 5500, 'h': 3300},
{'a': 'A', 'b': 'A', 'c': 'H', 'd': 'A', 'e': 'H', 'f': 'H', 'g': 'A', 'h': 'H'}, 50000],
{'points': 3532, 'reason': None, 'salary': 48600, 'valid': True})],
[('regression: salary cap boundary',
[{'CPT': 'g', 'FLEX': ['f', 'e', 'a', 'c', 'd']},
{'a': 1795, 'b': 628, 'c': 2001, 'd': -50, 'e': 1333, 'f': 1333, 'g': -45, 'h': 2835},
{'a': 5300, 'b': 7100, 'c': 10500, 'd': 9900, 'e': 5300, 'f': 5500, 'g': 8700, 'h': 5300},
{'a': 'A', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 49600],
{'points': 6344, 'reason': None, 'salary': 49600, 'valid': True}),
('partial repair probe: salary cap boundary',
[{'CPT': 'g', 'FLEX': ['e', 'c', 'b', 'd', 'a']},
{'a': 2241, 'b': 1664, 'c': 2001, 'd': 225, 'e': 1795, 'f': 2184, 'g': 225, 'h': 225},
{'a': 5300, 'b': 9900, 'c': 8700, 'd': 8700, 'e': 5300, 'f': 5500, 'g': 8700, 'h': 7100},
{'a': 'H', 'b': 'A', 'c': 'A', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'A', 'h': 'H'}, 50000],
{'points': 8264, 'reason': 'cap', 'salary': 51000, 'valid': False}),
('second regression',
[{'CPT': 'c', 'FLEX': ['f', 'h', 'd', 'e', 'g']},
{'a': 0, 'b': 2001, 'c': 0, 'd': -50, 'e': 1333, 'f': -45, 'g': 1795, 'h': 2001},
{'a': 8700, 'b': 10500, 'c': 5500, 'd': 8700, 'e': 5500, 'f': 7100, 'g': 10500, 'h': 7100},
{'a': 'A', 'b': 'A', 'c': 'A', 'd': 'A', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'H'}, 47100],
{'points': 5034, 'reason': 'cap', 'salary': 47200, 'valid': False}),
('normal control 1',
[{'CPT': 'b', 'FLEX': ['d', 'f', 'b', 'h', 'g']},
{'a': 225, 'b': 2001, 'c': 2001, 'd': 1333, 'e': -50, 'f': 0, 'g': 2001, 'h': 1333},
{'a': 9900, 'b': 9900, 'c': 3300, 'd': 3300, 'e': 5500, 'f': 3300, 'g': 8700, 'h': 5300},
{'a': 'H', 'b': 'A', 'c': 'H', 'd': 'A', 'e': 'A', 'f': 'H', 'g': 'A', 'h': 'A'}, 50000],
{'points': 9670, 'reason': 'roster', 'salary': 45400, 'valid': False}),
('normal control 2',
[{'CPT': 'd', 'FLEX': ['f', 'a', 'c', 'd', 'b']},
{'a': -45, 'b': -45, 'c': 0, 'd': -50, 'e': -94, 'f': 2001, 'g': 225, 'h': -50},
{'a': 7100, 'b': 5300, 'c': 3300, 'd': 3300, 'e': 3300, 'f': 7100, 'g': 5300, 'h': 10500},
{'a': 'A', 'b': 'H', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'A'}, 31000],
{'points': 1786, 'reason': 'roster', 'salary': 31100, 'valid': False}),
('normal control 3',
[{'CPT': 'e', 'FLEX': ['g', 'a', 'e', 'c', 'h']},
{'a': -45, 'b': -50, 'c': 225, 'd': -50, 'e': 0, 'f': -50, 'g': 0, 'h': 0},
{'a': 5300, 'b': 9900, 'c': 5500, 'd': 10500, 'e': 10500, 'f': 10500, 'g': 10500, 'h': 5300},
{'a': 'H', 'b': 'H', 'c': 'H', 'd': 'A', 'e': 'A', 'f': 'A', 'g': 'H', 'h': 'A'}, 50000],
{'points': 180, 'reason': 'roster', 'salary': 52900, 'valid': False}),
('normal control 4',
[{'CPT': 'f', 'FLEX': ['e', 'c', 'f', 'd', 'b']},
{'a': -45, 'b': 532, 'c': 0, 'd': 2001, 'e': 0, 'f': -50, 'g': 1385, 'h': -50},
{'a': 9900, 'b': 5500, 'c': 8700, 'd': 3300, 'e': 7100, 'f': 9900, 'g': 8700, 'h': 9900},
{'a': 'A', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'A'}, 49400],
{'points': 2408, 'reason': 'roster', 'salary': 49400, 'valid': False})],
[('regression: salary cap boundary',
[{'CPT': 'h', 'FLEX': ['c', 'd', 'a', 'e', 'f']},
{'a': 225, 'b': 225, 'c': 225, 'd': 2690, 'e': 0, 'f': 1333, 'g': 332, 'h': 1333},
{'a': 5300, 'b': 3300, 'c': 9900, 'd': 8700, 'e': 8700, 'f': 9900, 'g': 9900, 'h': 8700},
{'a': 'A', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'A', 'h': 'A'}, 55600],
{'points': 6473, 'reason': None, 'salary': 55600, 'valid': True}),
('partial repair probe: salary cap boundary',
[{'CPT': 'b', 'FLEX': ['c', 'a', 'g', 'e', 'h']},
{'a': -45, 'b': -45, 'c': -50, 'd': -45, 'e': 325, 'f': 225, 'g': 1333, 'h': 2279},
{'a': 9900, 'b': 8700, 'c': 5300, 'd': 5500, 'e': 10500, 'f': 3300, 'g': 7100, 'h': 5500},
{'a': 'A', 'b': 'A', 'c': 'A', 'd': 'H', 'e': 'A', 'f': 'A', 'g': 'H', 'h': 'A'}, 51300],
{'points': 3774, 'reason': 'cap', 'salary': 51400, 'valid': False}),
('second regression',
[{'CPT': 'h', 'FLEX': ['a', 'g', 'd', 'f', 'b']},
{'a': -50, 'b': 1333, 'c': 1795, 'd': -50, 'e': -50, 'f': 0, 'g': 741, 'h': -50},
{'a': 9900, 'b': 9900, 'c': 8700, 'd': 3300, 'e': 3300, 'f': 7100, 'g': 9900, 'h': 5500},
{'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'A'}, 48300],
{'points': 1899, 'reason': 'cap', 'salary': 48400, 'valid': False}),
('normal control 1',
[{'CPT': 'h', 'FLEX': ['f', 'c', 'h', 'b']},
{'a': 2001, 'b': 2001, 'c': -45, 'd': 439, 'e': 2001, 'f': 1333, 'g': 225, 'h': 0},
{'a': 10500, 'b': 9900, 'c': 9900, 'd': 3300, 'e': 9900, 'f': 8700, 'g': 5500, 'h': 5300},
{'a': 'A', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'A', 'g': 'H', 'h': 'H'}, 41900],
{'points': 3289, 'reason': 'roster', 'salary': 41800, 'valid': False}),
('normal control 2',
[{'CPT': 'h', 'FLEX': ['c', 'd', 'h', 'f']},
{'a': 2001, 'b': 1333, 'c': 1795, 'd': 1795, 'e': 0, 'f': 2915, 'g': 2001, 'h': -45},
{'a': 3300, 'b': 10500, 'c': 5300, 'd': 10500, 'e': 5500, 'f': 10500, 'g': 7100, 'h': 9900},
{'a': 'A', 'b': 'A', 'c': 'A', 'd': 'A', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 51000],
{'points': 6392, 'reason': 'roster', 'salary': 51100, 'valid': False}),
('normal control 3',
[{'CPT': 'c', 'FLEX': ['a', 'h', 'f', 'd', 'g']},
{'a': 2001, 'b': -45, 'c': 1333, 'd': 2807, 'e': 0, 'f': 1333, 'g': -45, 'h': 1333},
{'a': 10500, 'b': 3300, 'c': 10500, 'd': 5500, 'e': 5300, 'f': 10500, 'g': 8700, 'h': 5500},
{'a': 'H', 'b': 'H', 'c': 'H', 'd': 'A', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 50000],
{'points': 9429, 'reason': 'cap', 'salary': 56500, 'valid': False}),
('normal control 4',
[{'CPT': 'c', 'FLEX': ['h', 'f', 'g', 'c', 'e']},
{'a': 1333, 'b': -45, 'c': -50, 'd': -45, 'e': 1333, 'f': -45, 'g': 1795, 'h': -50},
{'a': 5500, 'b': 5500, 'c': 10500, 'd': 9900, 'e': 5300, 'f': 7100, 'g': 3300, 'h': 10500},
{'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'A'}, 52400],
{'points': 2908, 'reason': 'roster', 'salary': 52500, 'valid': False})],
[('regression: salary cap boundary',
[{'CPT': 'h', 'FLEX': ['a', 'c', 'e', 'd', 'f']},
{'a': 2001, 'b': -45, 'c': 225, 'd': 225, 'e': 1580, 'f': -50, 'g': -45, 'h': 0},
{'a': 3300, 'b': 7100, 'c': 8700, 'd': 8700, 'e': 10500, 'f': 5500, 'g': 5300, 'h': 5500},
{'a': 'H', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 45000],
{'points': 3981, 'reason': 'teams', 'salary': 45000, 'valid': False}),
('partial repair probe: salary cap boundary',
[{'CPT': 'b', 'FLEX': ['g', 'e', 'f', 'c', 'a']},
{'a': 1333, 'b': -50, 'c': 225, 'd': 1333, 'e': 1333, 'f': 225, 'g': 1795, 'h': 1795},
{'a': 10500, 'b': 5500, 'c': 5300, 'd': 8700, 'e': 8700, 'f': 10500, 'g': 7100, 'h': 3300},
{'a': 'A', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 50000],
{'points': 4836, 'reason': 'cap', 'salary': 50400, 'valid': False}),
('second regression',
[{'CPT': 'c', 'FLEX': ['h', 'f', 'd', 'g', 'a']},
{'a': -45, 'b': -45, 'c': 1333, 'd': 2001, 'e': 0, 'f': 225, 'g': -45, 'h': 2001},
{'a': 10500, 'b': 7100, 'c': 5500, 'd': 5500, 'e': 7100, 'f': 7100, 'g': 7100, 'h': 5300},
{'a': 'H', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'A', 'h': 'H'}, 43700],
{'points': 6137, 'reason': 'cap', 'salary': 43800, 'valid': False}),
('normal control 1',
[{'CPT': 'g', 'FLEX': ['b', 'a', 'g', 'e', 'd']},
{'a': 1333, 'b': -50, 'c': 0, 'd': 1551, 'e': 2001, 'f': 2001, 'g': -50, 'h': 1030},
{'a': 10500, 'b': 9900, 'c': 5300, 'd': 5300, 'e': 8700, 'f': 5500, 'g': 10500, 'h': 5300},
{'a': 'H', 'b': 'A', 'c': 'A', 'd': 'A', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'A'}, 60600],
{'points': 4710, 'reason': 'roster', 'salary': 60700, 'valid': False}),
('normal control 2',
[{'CPT': 'f', 'FLEX': ['h', 'f', 'e', 'a', 'c']},
{'a': 169, 'b': 2001, 'c': 0, 'd': 1333, 'e': -45, 'f': 2001, 'g': 2001, 'h': -45},
{'a': 5500, 'b': 5300, 'c': 7100, 'd': 8700, 'e': 8700, 'f': 3300, 'g': 8700, 'h': 5300},
{'a': 'H', 'b': 'A', 'c': 'A', 'd': 'A', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'A'}, 50000],
{'points': 5082, 'reason': 'roster', 'salary': 34900, 'valid': False}),
('normal control 3',
[{'CPT': 'e', 'FLEX': ['d', 'g', 'a', 'h']},
{'a': 0, 'b': 1020, 'c': 2001, 'd': 0, 'e': 2001, 'f': -45, 'g': -50, 'h': 225},
{'a': 7100, 'b': 9900, 'c': 5500, 'd': 8700, 'e': 5500, 'f': 7100, 'g': 5300, 'h': 8700},
{'a': 'A', 'b': 'A', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'A', 'h': 'H'}, 50000],
{'points': 3177, 'reason': 'roster', 'salary': 38100, 'valid': False}),
('normal control 4',
[{'CPT': 'd', 'FLEX': ['h', 'a', 'c', 'g', 'b']},
{'a': 225, 'b': 2001, 'c': 1333, 'd': 0, 'e': -45, 'f': 2498, 'g': 1795, 'h': 225},
{'a': 7100, 'b': 8700, 'c': 3300, 'd': 10500, 'e': 5300, 'f': 10500, 'g': 5300, 'h': 7100},
{'a': 'H', 'b': 'H', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 47400],
{'points': 5579, 'reason': None, 'salary': 47300, 'valid': True})],
[('regression: salary cap boundary',
[{'CPT': 'a', 'FLEX': ['g', 'e', 'd', 'c', 'h']},
{'a': 0, 'b': -50, 'c': 1108, 'd': 225, 'e': 2524, 'f': 1333, 'g': 1795, 'h': -45},
{'a': 10500, 'b': 5300, 'c': 5300, 'd': 10500, 'e': 5500, 'f': 7100, 'g': 3300, 'h': 5300},
{'a': 'A', 'b': 'A', 'c': 'H', 'd': 'A', 'e': 'A', 'f': 'A', 'g': 'H', 'h': 'A'}, 45700],
{'points': 5607, 'reason': None, 'salary': 45700, 'valid': True}),
('partial repair probe: salary cap boundary',
[{'CPT': 'a', 'FLEX': ['h', 'g', 'b', 'e', 'd']},
{'a': 2105, 'b': 1333, 'c': 1333, 'd': 1333, 'e': -45, 'f': -40, 'g': 1795, 'h': 2051},
{'a': 5300, 'b': 7100, 'c': 7100, 'd': 8700, 'e': 7100, 'f': 7100, 'g': 10500, 'h': 5500},
{'a': 'A', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'A', 'h': 'H'}, 46800],
{'points': 9625, 'reason': 'cap', 'salary': 46900, 'valid': False}),
('second regression',
[{'CPT': 'b', 'FLEX': ['g', 'f', 'c', 'h', 'd']},
{'a': -45, 'b': -45, 'c': -45, 'd': 225, 'e': 1333, 'f': 0, 'g': 1333, 'h': 376},
{'a': 5500, 'b': 7100, 'c': 9900, 'd': 10500, 'e': 7100, 'f': 9900, 'g': 9900, 'h': 3300},
{'a': 'H', 'b': 'H', 'c': 'A', 'd': 'A', 'e': 'A', 'f': 'H', 'g': 'A', 'h': 'H'}, 54200],
{'points': 1821, 'reason': None, 'salary': 54200, 'valid': True}),
('normal control 1',
[{'CPT': 'c', 'FLEX': ['f', 'h', 'b', 'c', 'e']},
{'a': 1795, 'b': 225, 'c': -45, 'd': 0, 'e': 2001, 'f': 225, 'g': 225, 'h': 1745},
{'a': 8700, 'b': 3300, 'c': 5300, 'd': 3300, 'e': 3300, 'f': 5500, 'g': 3300, 'h': 7100},
{'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'A'}, 32600],
{'points': 4083, 'reason': 'roster', 'salary': 32500, 'valid': False}),
('normal control 2',
[{'CPT': 'c', 'FLEX': ['h', 'b', 'a', 'd', 'c']},
{'a': 0, 'b': 0, 'c': -45, 'd': 225, 'e': -50, 'f': 2001, 'g': 1795, 'h': 225},
{'a': 3300, 'b': 3300, 'c': 7100, 'd': 3300, 'e': 9900, 'f': 3300, 'g': 7100, 'h': 7100},
{'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'A'}, 34900],
{'points': 337, 'reason': 'roster', 'salary': 34800, 'valid': False}),
('normal control 3',
[{'CPT': 'h', 'FLEX': ['e', 'b', 'f', 'h']},
{'a': 225, 'b': 940, 'c': 769, 'd': 0, 'e': -50, 'f': 1795, 'g': -45, 'h': 1333},
{'a': 5500, 'b': 8700, 'c': 10500, 'd': 5500, 'e': 10500, 'f': 10500, 'g': 3300, 'h': 3300},
{'a': 'H', 'b': 'H', 'c': 'A', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'A', 'h': 'H'}, 38000],
{'points': 6018, 'reason': 'roster', 'salary': 38000, 'valid': False}),
('normal control 4',
[{'CPT': 'f', 'FLEX': ['c', 'h', 'd', 'e', 'f']},
{'a': 0, 'b': 1681, 'c': -45, 'd': 0, 'e': 1333, 'f': 2001, 'g': -50, 'h': 0},
{'a': 3300, 'b': 3300, 'c': 9900, 'd': 9900, 'e': 5300, 'f': 9900, 'g': 3300, 'h': 7100},
{'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'A', 'h': 'H'}, 50000],
{'points': 6291, 'reason': 'roster', 'salary': 57000, 'valid': False})]]
for label, args, expected in fixtures[N-1]:
check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression: salary cap boundary | {'points': 6007, 'reason': None, 'salary': 53400, 'valid': True} | {'points': 6007, 'reason': None, 'salary': 53400, 'valid': True} | Passed |
| partial repair probe: salary cap boundary | {'points': 8350, 'reason': None, 'salary': 53800, 'valid': True} | {'points': 8350, 'reason': 'cap', 'salary': 53800, 'valid': False} | Failed |
| second regression | {'points': 8020, 'reason': None, 'salary': 59500, 'valid': True} | {'points': 8020, 'reason': None, 'salary': 59500, 'valid': True} | Passed |
| normal control 1 | {'points': 5466, 'reason': 'roster', 'salary': 43200, 'valid': False} | {'points': 5466, 'reason': 'roster', 'salary': 43200, 'valid': False} | Passed |
| normal control 2 | {'points': 6315, 'reason': None, 'salary': 51100, 'valid': True} | {'points': 6315, 'reason': None, 'salary': 51100, 'valid': True} | Passed |
| normal control 3 | {'points': 175, 'reason': 'roster', 'salary': 48000, 'valid': False} | {'points': 175, 'reason': 'roster', 'salary': 48000, 'valid': False} | Passed |
| normal control 4 | {'points': 3532, 'reason': None, 'salary': 48600, 'valid': True} | {'points': 3532, 'reason': None, 'salary': 48600, 'valid': True} | Passed |
SHA-256 / dd3f8859d43d8d0db39e6d1a7f8fb00519eb57b727f826dca678822ddd1c59bc
HELD IN THE MEMBER ARCHIVE
The verified repair and its recorded checks are member-only.
This mechanism has 7 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.
Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.
Member access is invitation-based. Sign in with your invited account to inspect the repair.
Sign in to the archive ↗Verification & scope
A deterministic toy scoring contract stipulated for this example; it is not the rulebook of any real fantasy platform. 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.
Observations recorded using Python 3.12.14 at 2026-09-29T14:50:37.010665+00:00.
Case digest / adaad579906446b252fcd1bc410a41e81add61389a00292a7163a2b5ea68c009