FA-85071 / Fantasy sports scoring / Open access
Captain team ignored in the two-team rule · case 01
Five flex players from one team plus an opposing captain are rejected.
ROOT CAUSE
The team-diversity check looks only at flex players.
VERIFIED REPAIR
Count teams across the captain and all flex players.
Unsuccessful approach: Slicing the first five names omits the last flex player from the team check.
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 flex}) < 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: two-team requirement',
[{'CPT': 'c', 'FLEX': ['e', 'h', 'b', 'd', 'f']},
{'a': 1333, 'b': 1795, 'c': -50, 'd': 723, 'e': 382, 'f': -45, 'g': 61, 'h': -50},
{'a': 9900, 'b': 9900, 'c': 3300, 'd': 3300, 'e': 3300, 'f': 3300, 'g': 5500, 'h': 3300},
{'a': 'H', 'b': 'H', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 28200],
{'points': 2730, 'reason': None, 'salary': 28100, 'valid': True}),
('partial repair probe: two-team requirement',
[{'CPT': 'g', 'FLEX': ['b', 'a', 'e', 'c', 'd']},
{'a': 2001, 'b': 225, 'c': 225, 'd': 1333, 'e': 225, 'f': 225, 'g': 1795, 'h': 0},
{'a': 9900, 'b': 3300, 'c': 9900, 'd': 7100, 'e': 8700, 'f': 10500, 'g': 8700, 'h': 9900},
{'a': 'H', 'b': 'H', 'c': 'H', 'd': 'A', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 52100],
{'points': 6702, 'reason': None, 'salary': 52000, 'valid': True}),
('second regression',
[{'CPT': 'a', 'FLEX': ['g', 'd', 'e', 'f', 'h']},
{'a': 225, 'b': 0, 'c': 1333, 'd': 225, 'e': -50, 'f': 225, 'g': -45, 'h': 1333},
{'a': 8700, 'b': 5300, 'c': 5500, 'd': 5500, 'e': 8700, 'f': 5500, 'g': 7100, 'h': 7100},
{'a': 'A', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 50000],
{'points': 2026, 'reason': None, 'salary': 47000, 'valid': True}),
('normal control 1',
[{'CPT': 'g', 'FLEX': ['g', 'h', 'c', 'e', 'f']},
{'a': 1795, 'b': 1692, 'c': -45, 'd': -50, 'e': 0, 'f': 1795, 'g': 2759, 'h': 0},
{'a': 9900, 'b': 9900, 'c': 5500, 'd': 10500, 'e': 3300, 'f': 9900, 'g': 9900, 'h': 5500},
{'a': 'H', 'b': 'H', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 48900],
{'points': 8648, 'reason': 'roster', 'salary': 49000, 'valid': False}),
('normal control 2',
[{'CPT': 'h', 'FLEX': ['g', 'e', 'h', 'b', 'c']},
{'a': -50, 'b': 1795, 'c': 2077, 'd': -45, 'e': 225, 'f': 2001, 'g': -50, 'h': 1333},
{'a': 5300, 'b': 3300, 'c': 3300, 'd': 7100, 'e': 8700, 'f': 10500, 'g': 8700, 'h': 5300},
{'a': 'H', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'A', 'g': 'A', 'h': 'H'}, 37400],
{'points': 7380, 'reason': 'roster', 'salary': 37300, 'valid': False}),
('normal control 3',
[{'CPT': 'd', 'FLEX': ['c', 'f', 'h', 'd', 'b']},
{'a': 2001, 'b': -50, 'c': -45, 'd': 1795, 'e': 2001, 'f': 2426, 'g': 2173, 'h': 225},
{'a': 9900, 'b': 3300, 'c': 5300, 'd': 7100, 'e': 7100, 'f': 5300, 'g': 5500, 'h': 9900},
{'a': 'H', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 41700],
{'points': 7044, 'reason': 'roster', 'salary': 41600, 'valid': False}),
('normal control 4',
[{'CPT': 'e', 'FLEX': ['c', 'a', 'f', 'b', 'd']},
{'a': 2001, 'b': -45, 'c': 1333, 'd': 1333, 'e': 0, 'f': 1333, 'g': 1795, 'h': 1120},
{'a': 3300, 'b': 9900, 'c': 7100, 'd': 5500, 'e': 9900, 'f': 7100, 'g': 8700, 'h': 9900},
{'a': 'H', 'b': 'H', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'A', 'h': 'A'}, 47900],
{'points': 5955, 'reason': None, 'salary': 47800, 'valid': True})],
[('regression: two-team requirement',
[{'CPT': 'a', 'FLEX': ['d', 'f', 'b', 'c', 'h']},
{'a': 1333, 'b': -45, 'c': -45, 'd': 0, 'e': 225, 'f': 2001, 'g': 1795, 'h': 225},
{'a': 10500, 'b': 7100, 'c': 9900, 'd': 7100, 'e': 3300, 'f': 10500, 'g': 5500, 'h': 5300},
{'a': 'A', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 55800],
{'points': 4136, 'reason': None, 'salary': 55700, 'valid': True}),
('partial repair probe: two-team requirement',
[{'CPT': 'e', 'FLEX': ['a', 'd', 'c', 'h', 'g']},
{'a': 1333, 'b': 225, 'c': 225, 'd': 1795, 'e': 225, 'f': 1333, 'g': -45, 'h': 225},
{'a': 7100, 'b': 7100, 'c': 7100, 'd': 10500, 'e': 7100, 'f': 8700, 'g': 3300, 'h': 7100},
{'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'A', 'h': 'H'}, 50000],
{'points': 3871, 'reason': None, 'salary': 45800, 'valid': True}),
('second regression',
[{'CPT': 'e', 'FLEX': ['g', 'b', 'a', 'd', 'c']},
{'a': 225, 'b': -45, 'c': 2001, 'd': 2001, 'e': -50, 'f': 0, 'g': 225, 'h': 2001},
{'a': 3300, 'b': 8700, 'c': 3300, 'd': 5500, 'e': 3300, 'f': 8700, 'g': 7100, 'h': 9900},
{'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'H'}, 33000],
{'points': 4332, 'reason': None, 'salary': 32900, 'valid': True}),
('normal control 1',
[{'CPT': 'a', 'FLEX': ['d', 'f', 'a', 'c', 'g']},
{'a': 2619, 'b': -45, 'c': 2001, 'd': -50, 'e': 0, 'f': 1795, 'g': 0, 'h': -45},
{'a': 10500, 'b': 7100, 'c': 8700, 'd': 5300, 'e': 8700, 'f': 9900, 'g': 5300, 'h': 5300},
{'a': 'H', 'b': 'H', 'c': 'H', 'd': 'A', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 50000],
{'points': 10294, 'reason': 'roster', 'salary': 55500, 'valid': False}),
('normal control 2',
[{'CPT': 'a', 'FLEX': ['h', 'e', 'c', 'b', 'a']},
{'a': 2001, 'b': -50, 'c': 1795, 'd': 2020, 'e': 2001, 'f': -45, 'g': 2001, 'h': 225},
{'a': 5500, 'b': 5500, 'c': 8700, 'd': 8700, 'e': 5300, 'f': 9900, 'g': 3300, 'h': 3300},
{'a': 'A', 'b': 'A', 'c': 'A', 'd': 'A', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 36700],
{'points': 8974, 'reason': 'roster', 'salary': 36600, 'valid': False}),
('normal control 3',
[{'CPT': 'a', 'FLEX': ['d', 'h', 'b', 'f', 'a']},
{'a': 2300, 'b': 225, 'c': -50, 'd': 114, 'e': 1333, 'f': 2849, 'g': 2001, 'h': -45},
{'a': 7100, 'b': 7100, 'c': 5300, 'd': 9900, 'e': 8700, 'f': 7100, 'g': 5300, 'h': 5500},
{'a': 'H', 'b': 'H', 'c': 'H', 'd': 'A', 'e': 'H', 'f': 'A', 'g': 'H', 'h': 'A'}, 47400],
{'points': 8893, 'reason': 'roster', 'salary': 47400, 'valid': False}),
('normal control 4',
[{'CPT': 'd', 'FLEX': ['c', 'h', 'a', 'f', 'e']},
{'a': 225, 'b': 1795, 'c': 2001, 'd': -50, 'e': 472, 'f': 225, 'g': 1333, 'h': 225},
{'a': 7100, 'b': 7100, 'c': 7100, 'd': 8700, 'e': 7100, 'f': 5300, 'g': 10500, 'h': 5300},
{'a': 'H', 'b': 'A', 'c': 'A', 'd': 'A', 'e': 'A', 'f': 'H', 'g': 'A', 'h': 'A'}, 50000],
{'points': 3073, 'reason': None, 'salary': 45000, 'valid': True})],
[('regression: two-team requirement',
[{'CPT': 'e', 'FLEX': ['f', 'd', 'c', 'a', 'h']},
{'a': -50, 'b': 2001, 'c': -50, 'd': 0, 'e': -45, 'f': 2001, 'g': -45, 'h': 1333},
{'a': 5300, 'b': 8700, 'c': 10500, 'd': 8700, 'e': 5300, 'f': 8700, 'g': 8700, 'h': 5500},
{'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'H'}, 50000],
{'points': 3166, 'reason': None, 'salary': 46700, 'valid': True}),
('partial repair probe: two-team requirement',
[{'CPT': 'd', 'FLEX': ['f', 'g', 'h', 'a', 'e']},
{'a': -45, 'b': -45, 'c': 2014, 'd': 1795, 'e': 1333, 'f': -50, 'g': 0, 'h': -50},
{'a': 5500, 'b': 5300, 'c': 7100, 'd': 3300, 'e': 7100, 'f': 5500, 'g': 10500, 'h': 3300},
{'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'H'}, 50000],
{'points': 3881, 'reason': None, 'salary': 36900, 'valid': True}),
('second regression',
[{'CPT': 'c', 'FLEX': ['h', 'f', 'g', 'b', 'a']},
{'a': -50, 'b': 821, 'c': 225, 'd': 1795, 'e': 1333, 'f': 1333, 'g': 1333, 'h': 2001},
{'a': 7100, 'b': 10500, 'c': 8700, 'd': 8700, 'e': 8700, 'f': 10500, 'g': 5500, 'h': 5500},
{'a': 'H', 'b': 'H', 'c': 'A', 'd': 'A', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 52200],
{'points': 5776, 'reason': None, 'salary': 52200, 'valid': True}),
('normal control 1',
[{'CPT': 'c', 'FLEX': ['b', 'c', 'f', 'a', 'g']},
{'a': 1795, 'b': 0, 'c': 1795, 'd': 0, 'e': 1795, 'f': 103, 'g': -50, 'h': 1795},
{'a': 5300, 'b': 10500, 'c': 5300, 'd': 7100, 'e': 3300, 'f': 8700, 'g': 8700, 'h': 5500},
{'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'A', 'h': 'H'}, 46500],
{'points': 6336, 'reason': 'roster', 'salary': 46500, 'valid': False}),
('normal control 2',
[{'CPT': 'e', 'FLEX': ['e', 'b', 'g', 'd', 'h']},
{'a': 1660, 'b': 0, 'c': 1684, 'd': 1228, 'e': 1795, 'f': -50, 'g': 2114, 'h': 1775},
{'a': 3300, 'b': 3300, 'c': 9900, 'd': 9900, 'e': 9900, 'f': 9900, 'g': 8700, 'h': 3300},
{'a': 'A', 'b': 'H', 'c': 'H', 'd': 'A', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 50100],
{'points': 9605, 'reason': 'roster', 'salary': 50000, 'valid': False}),
('normal control 3',
[{'CPT': 'd', 'FLEX': ['f', 'h', 'b', 'c', 'd']},
{'a': 1861, 'b': 104, 'c': 225, 'd': 1333, 'e': 2001, 'f': -45, 'g': -45, 'h': 1795},
{'a': 3300, 'b': 3300, 'c': 7100, 'd': 9900, 'e': 7100, 'f': 10500, 'g': 8700, 'h': 5300},
{'a': 'H', 'b': 'A', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'A', 'h': 'H'}, 51100],
{'points': 5412, 'reason': 'roster', 'salary': 51000, 'valid': False}),
('normal control 4',
[{'CPT': 'h', 'FLEX': ['a', 'f', 'b', 'g', 'c']},
{'a': 0, 'b': 1333, 'c': 1795, 'd': 1795, 'e': 0, 'f': 2001, 'g': 225, 'h': 225},
{'a': 9900, 'b': 10500, 'c': 9900, 'd': 8700, 'e': 10500, 'f': 9900, 'g': 5500, 'h': 9900},
{'a': 'H', 'b': 'H', 'c': 'A', 'd': 'A', 'e': 'H', 'f': 'H', 'g': 'A', 'h': 'A'}, 50000],
{'points': 5692, 'reason': 'cap', 'salary': 60600, 'valid': False})],
[('regression: two-team requirement',
[{'CPT': 'c', 'FLEX': ['d', 'h', 'a', 'e', 'g']},
{'a': 1333, 'b': 225, 'c': 1333, 'd': 225, 'e': 2911, 'f': 1333, 'g': -50, 'h': 225},
{'a': 8700, 'b': 5500, 'c': 3300, 'd': 10500, 'e': 5500, 'f': 9900, 'g': 10500, 'h': 8700},
{'a': 'H', 'b': 'H', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 50000],
{'points': 6644, 'reason': None, 'salary': 48900, 'valid': True}),
('partial repair probe: two-team requirement',
[{'CPT': 'd', 'FLEX': ['e', 'f', 'a', 'b', 'h']},
{'a': 225, 'b': 1795, 'c': -80, 'd': 1333, 'e': 1700, 'f': 0, 'g': 2205, 'h': -50},
{'a': 7100, 'b': 5300, 'c': 5300, 'd': 7100, 'e': 5300, 'f': 5300, 'g': 10500, 'h': 8700},
{'a': 'H', 'b': 'H', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'A', 'h': 'A'}, 42500],
{'points': 5670, 'reason': None, 'salary': 42400, 'valid': True}),
('second regression',
[{'CPT': 'h', 'FLEX': ['a', 'g', 'b', 'd', 'f']},
{'a': 2001, 'b': -50, 'c': -50, 'd': 1333, 'e': 1333, 'f': 225, 'g': -45, 'h': -45},
{'a': 9900, 'b': 8700, 'c': 7100, 'd': 7100, 'e': 5500, 'f': 9900, 'g': 10500, 'h': 7100},
{'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'A'}, 56800],
{'points': 3396, 'reason': None, 'salary': 56800, 'valid': True}),
('normal control 1',
[{'CPT': 'a', 'FLEX': ['g', 'h', 'a', 'd', 'f']},
{'a': -50, 'b': 0, 'c': 225, 'd': 2048, 'e': 0, 'f': 1951, 'g': 1333, 'h': 1795},
{'a': 10500, 'b': 7100, 'c': 8700, 'd': 3300, 'e': 9900, 'f': 10500, 'g': 10500, 'h': 10500},
{'a': 'H', 'b': 'A', 'c': 'A', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'A'}, 61200],
{'points': 7002, 'reason': 'roster', 'salary': 61100, 'valid': False}),
('normal control 2',
[{'CPT': 'h', 'FLEX': ['b', 'h', 'c', 'e', 'g']},
{'a': -45, 'b': 2001, 'c': 225, 'd': 1333, 'e': -50, 'f': -45, 'g': -50, 'h': 2001},
{'a': 5500, 'b': 5500, 'c': 5300, 'd': 9900, 'e': 9900, 'f': 5500, 'g': 5300, 'h': 9900},
{'a': 'H', 'b': 'H', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 50800],
{'points': 7129, 'reason': 'roster', 'salary': 50800, 'valid': False}),
('normal control 3',
[{'CPT': 'a', 'FLEX': ['f', 'c', 'e', 'h', 'b']},
{'a': -45, 'b': 2001, 'c': 2001, 'd': 0, 'e': 2001, 'f': 1795, 'g': 225, 'h': -45},
{'a': 9900, 'b': 5300, 'c': 9900, 'd': 7100, 'e': 9900, 'f': 8700, 'g': 10500, 'h': 10500},
{'a': 'H', 'b': 'H', 'c': 'A', 'd': 'A', 'e': 'H', 'f': 'A', 'g': 'H', 'h': 'A'}, 50000],
{'points': 7685, 'reason': 'cap', 'salary': 59200, 'valid': False}),
('normal control 4',
[{'CPT': 'f', 'FLEX': ['b', 'f', 'a', 'h', 'c']},
{'a': 1333, 'b': 2001, 'c': 1886, 'd': 1795, 'e': 1390, 'f': 225, 'g': 0, 'h': 225},
{'a': 10500, 'b': 5300, 'c': 5500, 'd': 8700, 'e': 8700, 'f': 3300, 'g': 7100, 'h': 7100},
{'a': 'A', 'b': 'H', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'A', 'g': 'H', 'h': 'A'}, 36600],
{'points': 6008, 'reason': 'roster', 'salary': 36700, 'valid': False})],
[('regression: two-team requirement',
[{'CPT': 'b', 'FLEX': ['h', 'd', 'a', 'g', 'c']},
{'a': 1652, 'b': 0, 'c': 2001, 'd': 2001, 'e': -50, 'f': 2001, 'g': 0, 'h': -45},
{'a': 5300, 'b': 8700, 'c': 10500, 'd': 8700, 'e': 5500, 'f': 8700, 'g': 10500, 'h': 5500},
{'a': 'H', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 53700],
{'points': 5609, 'reason': None, 'salary': 53600, 'valid': True}),
('partial repair probe: two-team requirement',
[{'CPT': 'g', 'FLEX': ['b', 'd', 'f', 'c', 'h']},
{'a': 1840, 'b': 1333, 'c': 2671, 'd': -50, 'e': -50, 'f': 2001, 'g': -45, 'h': -45},
{'a': 7100, 'b': 3300, 'c': 5500, 'd': 10500, 'e': 10500, 'f': 10500, 'g': 8700, 'h': 7100},
{'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'A'}, 50000],
{'points': 5842, 'reason': None, 'salary': 50000, 'valid': True}),
('second regression',
[{'CPT': 'f', 'FLEX': ['a', 'g', 'd', 'e', 'c']},
{'a': -45, 'b': -50, 'c': 2612, 'd': 225, 'e': 0, 'f': 1333, 'g': -50, 'h': -45},
{'a': 5500, 'b': 5300, 'c': 10500, 'd': 8700, 'e': 5500, 'f': 10500, 'g': 7100, 'h': 10500},
{'a': 'A', 'b': 'A', 'c': 'A', 'd': 'A', 'e': 'A', 'f': 'H', 'g': 'A', 'h': 'A'}, 53100],
{'points': 4742, 'reason': None, 'salary': 53100, 'valid': True}),
('normal control 1',
[{'CPT': 'c', 'FLEX': ['b', 'a', 'd', 'h', 'f']},
{'a': -50, 'b': 267, 'c': 2001, 'd': 2001, 'e': 225, 'f': -45, 'g': -50, 'h': 0},
{'a': 7100, 'b': 9900, 'c': 9900, 'd': 8700, 'e': 9900, 'f': 5500, 'g': 9900, 'h': 5300},
{'a': 'A', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 51400],
{'points': 5175, 'reason': None, 'salary': 51400, 'valid': True}),
('normal control 2',
[{'CPT': 'b', 'FLEX': ['g', 'e', 'b', 'h', 'c']},
{'a': 0, 'b': 1333, 'c': 1333, 'd': 2912, 'e': 1333, 'f': 225, 'g': 0, 'h': -50},
{'a': 5500, 'b': 8700, 'c': 9900, 'd': 5300, 'e': 7100, 'f': 3300, 'g': 5300, 'h': 3300},
{'a': 'A', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'A', 'f': 'A', 'g': 'H', 'h': 'H'}, 47400],
{'points': 5949, 'reason': 'roster', 'salary': 47400, 'valid': False}),
('normal control 3',
[{'CPT': 'b', 'FLEX': ['a', 'e', 'c', 'h', 'f']},
{'a': 2001, 'b': 1795, 'c': 582, 'd': 1795, 'e': -45, 'f': -45, 'g': -45, 'h': 215},
{'a': 3300, 'b': 7100, 'c': 9900, 'd': 5300, 'e': 10500, 'f': 7100, 'g': 7100, 'h': 10500},
{'a': 'H', 'b': 'H', 'c': 'H', 'd': 'A', 'e': 'A', 'f': 'H', 'g': 'A', 'h': 'A'}, 52000],
{'points': 5401, 'reason': None, 'salary': 52000, 'valid': True}),
('normal control 4',
[{'CPT': 'b', 'FLEX': ['a', 'g', 'e', 'h', 'c']},
{'a': 1795, 'b': 2582, 'c': 1795, 'd': -45, 'e': -50, 'f': 2001, 'g': 225, 'h': -45},
{'a': 7100, 'b': 5300, 'c': 7100, 'd': 7100, 'e': 7100, 'f': 10500, 'g': 5300, 'h': 9900},
{'a': 'A', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 44400],
{'points': 7593, 'reason': 'cap', 'salary': 44500, '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: two-team requirement | {'points': 2730, 'reason': 'teams', 'salary': 28100, 'valid': False} | {'points': 2730, 'reason': None, 'salary': 28100, 'valid': True} | Failed |
| partial repair probe: two-team requirement | {'points': 6702, 'reason': None, 'salary': 52000, 'valid': True} | {'points': 6702, 'reason': None, 'salary': 52000, 'valid': True} | Passed |
| second regression | {'points': 2026, 'reason': 'teams', 'salary': 47000, 'valid': False} | {'points': 2026, 'reason': None, 'salary': 47000, 'valid': True} | Failed |
| normal control 1 | {'points': 8648, 'reason': 'roster', 'salary': 49000, 'valid': False} | {'points': 8648, 'reason': 'roster', 'salary': 49000, 'valid': False} | Passed |
| normal control 2 | {'points': 7380, 'reason': 'roster', 'salary': 37300, 'valid': False} | {'points': 7380, 'reason': 'roster', 'salary': 37300, 'valid': False} | Passed |
| normal control 3 | {'points': 7044, 'reason': 'roster', 'salary': 41600, 'valid': False} | {'points': 7044, 'reason': 'roster', 'salary': 41600, 'valid': False} | Passed |
| normal control 4 | {'points': 5955, 'reason': None, 'salary': 47800, 'valid': True} | {'points': 5955, 'reason': None, 'salary': 47800, 'valid': True} | Passed |
SHA-256 / 87569006199d1faabccd2595c970dc88b0f2a97d36f42a1d08e3442a0bd16989
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 > cap:
return {'valid': False, 'reason': 'cap', 'salary': salary, 'points': total}
if len({teams[p] for p in names[:5]}) < 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: two-team requirement',
[{'CPT': 'c', 'FLEX': ['e', 'h', 'b', 'd', 'f']},
{'a': 1333, 'b': 1795, 'c': -50, 'd': 723, 'e': 382, 'f': -45, 'g': 61, 'h': -50},
{'a': 9900, 'b': 9900, 'c': 3300, 'd': 3300, 'e': 3300, 'f': 3300, 'g': 5500, 'h': 3300},
{'a': 'H', 'b': 'H', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 28200],
{'points': 2730, 'reason': None, 'salary': 28100, 'valid': True}),
('partial repair probe: two-team requirement',
[{'CPT': 'g', 'FLEX': ['b', 'a', 'e', 'c', 'd']},
{'a': 2001, 'b': 225, 'c': 225, 'd': 1333, 'e': 225, 'f': 225, 'g': 1795, 'h': 0},
{'a': 9900, 'b': 3300, 'c': 9900, 'd': 7100, 'e': 8700, 'f': 10500, 'g': 8700, 'h': 9900},
{'a': 'H', 'b': 'H', 'c': 'H', 'd': 'A', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 52100],
{'points': 6702, 'reason': None, 'salary': 52000, 'valid': True}),
('second regression',
[{'CPT': 'a', 'FLEX': ['g', 'd', 'e', 'f', 'h']},
{'a': 225, 'b': 0, 'c': 1333, 'd': 225, 'e': -50, 'f': 225, 'g': -45, 'h': 1333},
{'a': 8700, 'b': 5300, 'c': 5500, 'd': 5500, 'e': 8700, 'f': 5500, 'g': 7100, 'h': 7100},
{'a': 'A', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 50000],
{'points': 2026, 'reason': None, 'salary': 47000, 'valid': True}),
('normal control 1',
[{'CPT': 'g', 'FLEX': ['g', 'h', 'c', 'e', 'f']},
{'a': 1795, 'b': 1692, 'c': -45, 'd': -50, 'e': 0, 'f': 1795, 'g': 2759, 'h': 0},
{'a': 9900, 'b': 9900, 'c': 5500, 'd': 10500, 'e': 3300, 'f': 9900, 'g': 9900, 'h': 5500},
{'a': 'H', 'b': 'H', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 48900],
{'points': 8648, 'reason': 'roster', 'salary': 49000, 'valid': False}),
('normal control 2',
[{'CPT': 'h', 'FLEX': ['g', 'e', 'h', 'b', 'c']},
{'a': -50, 'b': 1795, 'c': 2077, 'd': -45, 'e': 225, 'f': 2001, 'g': -50, 'h': 1333},
{'a': 5300, 'b': 3300, 'c': 3300, 'd': 7100, 'e': 8700, 'f': 10500, 'g': 8700, 'h': 5300},
{'a': 'H', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'A', 'g': 'A', 'h': 'H'}, 37400],
{'points': 7380, 'reason': 'roster', 'salary': 37300, 'valid': False}),
('normal control 3',
[{'CPT': 'd', 'FLEX': ['c', 'f', 'h', 'd', 'b']},
{'a': 2001, 'b': -50, 'c': -45, 'd': 1795, 'e': 2001, 'f': 2426, 'g': 2173, 'h': 225},
{'a': 9900, 'b': 3300, 'c': 5300, 'd': 7100, 'e': 7100, 'f': 5300, 'g': 5500, 'h': 9900},
{'a': 'H', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 41700],
{'points': 7044, 'reason': 'roster', 'salary': 41600, 'valid': False}),
('normal control 4',
[{'CPT': 'e', 'FLEX': ['c', 'a', 'f', 'b', 'd']},
{'a': 2001, 'b': -45, 'c': 1333, 'd': 1333, 'e': 0, 'f': 1333, 'g': 1795, 'h': 1120},
{'a': 3300, 'b': 9900, 'c': 7100, 'd': 5500, 'e': 9900, 'f': 7100, 'g': 8700, 'h': 9900},
{'a': 'H', 'b': 'H', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'A', 'h': 'A'}, 47900],
{'points': 5955, 'reason': None, 'salary': 47800, 'valid': True})],
[('regression: two-team requirement',
[{'CPT': 'a', 'FLEX': ['d', 'f', 'b', 'c', 'h']},
{'a': 1333, 'b': -45, 'c': -45, 'd': 0, 'e': 225, 'f': 2001, 'g': 1795, 'h': 225},
{'a': 10500, 'b': 7100, 'c': 9900, 'd': 7100, 'e': 3300, 'f': 10500, 'g': 5500, 'h': 5300},
{'a': 'A', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 55800],
{'points': 4136, 'reason': None, 'salary': 55700, 'valid': True}),
('partial repair probe: two-team requirement',
[{'CPT': 'e', 'FLEX': ['a', 'd', 'c', 'h', 'g']},
{'a': 1333, 'b': 225, 'c': 225, 'd': 1795, 'e': 225, 'f': 1333, 'g': -45, 'h': 225},
{'a': 7100, 'b': 7100, 'c': 7100, 'd': 10500, 'e': 7100, 'f': 8700, 'g': 3300, 'h': 7100},
{'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'A', 'h': 'H'}, 50000],
{'points': 3871, 'reason': None, 'salary': 45800, 'valid': True}),
('second regression',
[{'CPT': 'e', 'FLEX': ['g', 'b', 'a', 'd', 'c']},
{'a': 225, 'b': -45, 'c': 2001, 'd': 2001, 'e': -50, 'f': 0, 'g': 225, 'h': 2001},
{'a': 3300, 'b': 8700, 'c': 3300, 'd': 5500, 'e': 3300, 'f': 8700, 'g': 7100, 'h': 9900},
{'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'H'}, 33000],
{'points': 4332, 'reason': None, 'salary': 32900, 'valid': True}),
('normal control 1',
[{'CPT': 'a', 'FLEX': ['d', 'f', 'a', 'c', 'g']},
{'a': 2619, 'b': -45, 'c': 2001, 'd': -50, 'e': 0, 'f': 1795, 'g': 0, 'h': -45},
{'a': 10500, 'b': 7100, 'c': 8700, 'd': 5300, 'e': 8700, 'f': 9900, 'g': 5300, 'h': 5300},
{'a': 'H', 'b': 'H', 'c': 'H', 'd': 'A', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 50000],
{'points': 10294, 'reason': 'roster', 'salary': 55500, 'valid': False}),
('normal control 2',
[{'CPT': 'a', 'FLEX': ['h', 'e', 'c', 'b', 'a']},
{'a': 2001, 'b': -50, 'c': 1795, 'd': 2020, 'e': 2001, 'f': -45, 'g': 2001, 'h': 225},
{'a': 5500, 'b': 5500, 'c': 8700, 'd': 8700, 'e': 5300, 'f': 9900, 'g': 3300, 'h': 3300},
{'a': 'A', 'b': 'A', 'c': 'A', 'd': 'A', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 36700],
{'points': 8974, 'reason': 'roster', 'salary': 36600, 'valid': False}),
('normal control 3',
[{'CPT': 'a', 'FLEX': ['d', 'h', 'b', 'f', 'a']},
{'a': 2300, 'b': 225, 'c': -50, 'd': 114, 'e': 1333, 'f': 2849, 'g': 2001, 'h': -45},
{'a': 7100, 'b': 7100, 'c': 5300, 'd': 9900, 'e': 8700, 'f': 7100, 'g': 5300, 'h': 5500},
{'a': 'H', 'b': 'H', 'c': 'H', 'd': 'A', 'e': 'H', 'f': 'A', 'g': 'H', 'h': 'A'}, 47400],
{'points': 8893, 'reason': 'roster', 'salary': 47400, 'valid': False}),
('normal control 4',
[{'CPT': 'd', 'FLEX': ['c', 'h', 'a', 'f', 'e']},
{'a': 225, 'b': 1795, 'c': 2001, 'd': -50, 'e': 472, 'f': 225, 'g': 1333, 'h': 225},
{'a': 7100, 'b': 7100, 'c': 7100, 'd': 8700, 'e': 7100, 'f': 5300, 'g': 10500, 'h': 5300},
{'a': 'H', 'b': 'A', 'c': 'A', 'd': 'A', 'e': 'A', 'f': 'H', 'g': 'A', 'h': 'A'}, 50000],
{'points': 3073, 'reason': None, 'salary': 45000, 'valid': True})],
[('regression: two-team requirement',
[{'CPT': 'e', 'FLEX': ['f', 'd', 'c', 'a', 'h']},
{'a': -50, 'b': 2001, 'c': -50, 'd': 0, 'e': -45, 'f': 2001, 'g': -45, 'h': 1333},
{'a': 5300, 'b': 8700, 'c': 10500, 'd': 8700, 'e': 5300, 'f': 8700, 'g': 8700, 'h': 5500},
{'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'H'}, 50000],
{'points': 3166, 'reason': None, 'salary': 46700, 'valid': True}),
('partial repair probe: two-team requirement',
[{'CPT': 'd', 'FLEX': ['f', 'g', 'h', 'a', 'e']},
{'a': -45, 'b': -45, 'c': 2014, 'd': 1795, 'e': 1333, 'f': -50, 'g': 0, 'h': -50},
{'a': 5500, 'b': 5300, 'c': 7100, 'd': 3300, 'e': 7100, 'f': 5500, 'g': 10500, 'h': 3300},
{'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'H'}, 50000],
{'points': 3881, 'reason': None, 'salary': 36900, 'valid': True}),
('second regression',
[{'CPT': 'c', 'FLEX': ['h', 'f', 'g', 'b', 'a']},
{'a': -50, 'b': 821, 'c': 225, 'd': 1795, 'e': 1333, 'f': 1333, 'g': 1333, 'h': 2001},
{'a': 7100, 'b': 10500, 'c': 8700, 'd': 8700, 'e': 8700, 'f': 10500, 'g': 5500, 'h': 5500},
{'a': 'H', 'b': 'H', 'c': 'A', 'd': 'A', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 52200],
{'points': 5776, 'reason': None, 'salary': 52200, 'valid': True}),
('normal control 1',
[{'CPT': 'c', 'FLEX': ['b', 'c', 'f', 'a', 'g']},
{'a': 1795, 'b': 0, 'c': 1795, 'd': 0, 'e': 1795, 'f': 103, 'g': -50, 'h': 1795},
{'a': 5300, 'b': 10500, 'c': 5300, 'd': 7100, 'e': 3300, 'f': 8700, 'g': 8700, 'h': 5500},
{'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'A', 'h': 'H'}, 46500],
{'points': 6336, 'reason': 'roster', 'salary': 46500, 'valid': False}),
('normal control 2',
[{'CPT': 'e', 'FLEX': ['e', 'b', 'g', 'd', 'h']},
{'a': 1660, 'b': 0, 'c': 1684, 'd': 1228, 'e': 1795, 'f': -50, 'g': 2114, 'h': 1775},
{'a': 3300, 'b': 3300, 'c': 9900, 'd': 9900, 'e': 9900, 'f': 9900, 'g': 8700, 'h': 3300},
{'a': 'A', 'b': 'H', 'c': 'H', 'd': 'A', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 50100],
{'points': 9605, 'reason': 'roster', 'salary': 50000, 'valid': False}),
('normal control 3',
[{'CPT': 'd', 'FLEX': ['f', 'h', 'b', 'c', 'd']},
{'a': 1861, 'b': 104, 'c': 225, 'd': 1333, 'e': 2001, 'f': -45, 'g': -45, 'h': 1795},
{'a': 3300, 'b': 3300, 'c': 7100, 'd': 9900, 'e': 7100, 'f': 10500, 'g': 8700, 'h': 5300},
{'a': 'H', 'b': 'A', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'A', 'h': 'H'}, 51100],
{'points': 5412, 'reason': 'roster', 'salary': 51000, 'valid': False}),
('normal control 4',
[{'CPT': 'h', 'FLEX': ['a', 'f', 'b', 'g', 'c']},
{'a': 0, 'b': 1333, 'c': 1795, 'd': 1795, 'e': 0, 'f': 2001, 'g': 225, 'h': 225},
{'a': 9900, 'b': 10500, 'c': 9900, 'd': 8700, 'e': 10500, 'f': 9900, 'g': 5500, 'h': 9900},
{'a': 'H', 'b': 'H', 'c': 'A', 'd': 'A', 'e': 'H', 'f': 'H', 'g': 'A', 'h': 'A'}, 50000],
{'points': 5692, 'reason': 'cap', 'salary': 60600, 'valid': False})],
[('regression: two-team requirement',
[{'CPT': 'c', 'FLEX': ['d', 'h', 'a', 'e', 'g']},
{'a': 1333, 'b': 225, 'c': 1333, 'd': 225, 'e': 2911, 'f': 1333, 'g': -50, 'h': 225},
{'a': 8700, 'b': 5500, 'c': 3300, 'd': 10500, 'e': 5500, 'f': 9900, 'g': 10500, 'h': 8700},
{'a': 'H', 'b': 'H', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 50000],
{'points': 6644, 'reason': None, 'salary': 48900, 'valid': True}),
('partial repair probe: two-team requirement',
[{'CPT': 'd', 'FLEX': ['e', 'f', 'a', 'b', 'h']},
{'a': 225, 'b': 1795, 'c': -80, 'd': 1333, 'e': 1700, 'f': 0, 'g': 2205, 'h': -50},
{'a': 7100, 'b': 5300, 'c': 5300, 'd': 7100, 'e': 5300, 'f': 5300, 'g': 10500, 'h': 8700},
{'a': 'H', 'b': 'H', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'A', 'h': 'A'}, 42500],
{'points': 5670, 'reason': None, 'salary': 42400, 'valid': True}),
('second regression',
[{'CPT': 'h', 'FLEX': ['a', 'g', 'b', 'd', 'f']},
{'a': 2001, 'b': -50, 'c': -50, 'd': 1333, 'e': 1333, 'f': 225, 'g': -45, 'h': -45},
{'a': 9900, 'b': 8700, 'c': 7100, 'd': 7100, 'e': 5500, 'f': 9900, 'g': 10500, 'h': 7100},
{'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'A'}, 56800],
{'points': 3396, 'reason': None, 'salary': 56800, 'valid': True}),
('normal control 1',
[{'CPT': 'a', 'FLEX': ['g', 'h', 'a', 'd', 'f']},
{'a': -50, 'b': 0, 'c': 225, 'd': 2048, 'e': 0, 'f': 1951, 'g': 1333, 'h': 1795},
{'a': 10500, 'b': 7100, 'c': 8700, 'd': 3300, 'e': 9900, 'f': 10500, 'g': 10500, 'h': 10500},
{'a': 'H', 'b': 'A', 'c': 'A', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'A'}, 61200],
{'points': 7002, 'reason': 'roster', 'salary': 61100, 'valid': False}),
('normal control 2',
[{'CPT': 'h', 'FLEX': ['b', 'h', 'c', 'e', 'g']},
{'a': -45, 'b': 2001, 'c': 225, 'd': 1333, 'e': -50, 'f': -45, 'g': -50, 'h': 2001},
{'a': 5500, 'b': 5500, 'c': 5300, 'd': 9900, 'e': 9900, 'f': 5500, 'g': 5300, 'h': 9900},
{'a': 'H', 'b': 'H', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 50800],
{'points': 7129, 'reason': 'roster', 'salary': 50800, 'valid': False}),
('normal control 3',
[{'CPT': 'a', 'FLEX': ['f', 'c', 'e', 'h', 'b']},
{'a': -45, 'b': 2001, 'c': 2001, 'd': 0, 'e': 2001, 'f': 1795, 'g': 225, 'h': -45},
{'a': 9900, 'b': 5300, 'c': 9900, 'd': 7100, 'e': 9900, 'f': 8700, 'g': 10500, 'h': 10500},
{'a': 'H', 'b': 'H', 'c': 'A', 'd': 'A', 'e': 'H', 'f': 'A', 'g': 'H', 'h': 'A'}, 50000],
{'points': 7685, 'reason': 'cap', 'salary': 59200, 'valid': False}),
('normal control 4',
[{'CPT': 'f', 'FLEX': ['b', 'f', 'a', 'h', 'c']},
{'a': 1333, 'b': 2001, 'c': 1886, 'd': 1795, 'e': 1390, 'f': 225, 'g': 0, 'h': 225},
{'a': 10500, 'b': 5300, 'c': 5500, 'd': 8700, 'e': 8700, 'f': 3300, 'g': 7100, 'h': 7100},
{'a': 'A', 'b': 'H', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'A', 'g': 'H', 'h': 'A'}, 36600],
{'points': 6008, 'reason': 'roster', 'salary': 36700, 'valid': False})],
[('regression: two-team requirement',
[{'CPT': 'b', 'FLEX': ['h', 'd', 'a', 'g', 'c']},
{'a': 1652, 'b': 0, 'c': 2001, 'd': 2001, 'e': -50, 'f': 2001, 'g': 0, 'h': -45},
{'a': 5300, 'b': 8700, 'c': 10500, 'd': 8700, 'e': 5500, 'f': 8700, 'g': 10500, 'h': 5500},
{'a': 'H', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 53700],
{'points': 5609, 'reason': None, 'salary': 53600, 'valid': True}),
('partial repair probe: two-team requirement',
[{'CPT': 'g', 'FLEX': ['b', 'd', 'f', 'c', 'h']},
{'a': 1840, 'b': 1333, 'c': 2671, 'd': -50, 'e': -50, 'f': 2001, 'g': -45, 'h': -45},
{'a': 7100, 'b': 3300, 'c': 5500, 'd': 10500, 'e': 10500, 'f': 10500, 'g': 8700, 'h': 7100},
{'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'A'}, 50000],
{'points': 5842, 'reason': None, 'salary': 50000, 'valid': True}),
('second regression',
[{'CPT': 'f', 'FLEX': ['a', 'g', 'd', 'e', 'c']},
{'a': -45, 'b': -50, 'c': 2612, 'd': 225, 'e': 0, 'f': 1333, 'g': -50, 'h': -45},
{'a': 5500, 'b': 5300, 'c': 10500, 'd': 8700, 'e': 5500, 'f': 10500, 'g': 7100, 'h': 10500},
{'a': 'A', 'b': 'A', 'c': 'A', 'd': 'A', 'e': 'A', 'f': 'H', 'g': 'A', 'h': 'A'}, 53100],
{'points': 4742, 'reason': None, 'salary': 53100, 'valid': True}),
('normal control 1',
[{'CPT': 'c', 'FLEX': ['b', 'a', 'd', 'h', 'f']},
{'a': -50, 'b': 267, 'c': 2001, 'd': 2001, 'e': 225, 'f': -45, 'g': -50, 'h': 0},
{'a': 7100, 'b': 9900, 'c': 9900, 'd': 8700, 'e': 9900, 'f': 5500, 'g': 9900, 'h': 5300},
{'a': 'A', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 51400],
{'points': 5175, 'reason': None, 'salary': 51400, 'valid': True}),
('normal control 2',
[{'CPT': 'b', 'FLEX': ['g', 'e', 'b', 'h', 'c']},
{'a': 0, 'b': 1333, 'c': 1333, 'd': 2912, 'e': 1333, 'f': 225, 'g': 0, 'h': -50},
{'a': 5500, 'b': 8700, 'c': 9900, 'd': 5300, 'e': 7100, 'f': 3300, 'g': 5300, 'h': 3300},
{'a': 'A', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'A', 'f': 'A', 'g': 'H', 'h': 'H'}, 47400],
{'points': 5949, 'reason': 'roster', 'salary': 47400, 'valid': False}),
('normal control 3',
[{'CPT': 'b', 'FLEX': ['a', 'e', 'c', 'h', 'f']},
{'a': 2001, 'b': 1795, 'c': 582, 'd': 1795, 'e': -45, 'f': -45, 'g': -45, 'h': 215},
{'a': 3300, 'b': 7100, 'c': 9900, 'd': 5300, 'e': 10500, 'f': 7100, 'g': 7100, 'h': 10500},
{'a': 'H', 'b': 'H', 'c': 'H', 'd': 'A', 'e': 'A', 'f': 'H', 'g': 'A', 'h': 'A'}, 52000],
{'points': 5401, 'reason': None, 'salary': 52000, 'valid': True}),
('normal control 4',
[{'CPT': 'b', 'FLEX': ['a', 'g', 'e', 'h', 'c']},
{'a': 1795, 'b': 2582, 'c': 1795, 'd': -45, 'e': -50, 'f': 2001, 'g': 225, 'h': -45},
{'a': 7100, 'b': 5300, 'c': 7100, 'd': 7100, 'e': 7100, 'f': 10500, 'g': 5300, 'h': 9900},
{'a': 'A', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 44400],
{'points': 7593, 'reason': 'cap', 'salary': 44500, '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: two-team requirement | {'points': 2730, 'reason': None, 'salary': 28100, 'valid': True} | {'points': 2730, 'reason': None, 'salary': 28100, 'valid': True} | Passed |
| partial repair probe: two-team requirement | {'points': 6702, 'reason': 'teams', 'salary': 52000, 'valid': False} | {'points': 6702, 'reason': None, 'salary': 52000, 'valid': True} | Failed |
| second regression | {'points': 2026, 'reason': None, 'salary': 47000, 'valid': True} | {'points': 2026, 'reason': None, 'salary': 47000, 'valid': True} | Passed |
| normal control 1 | {'points': 8648, 'reason': 'roster', 'salary': 49000, 'valid': False} | {'points': 8648, 'reason': 'roster', 'salary': 49000, 'valid': False} | Passed |
| normal control 2 | {'points': 7380, 'reason': 'roster', 'salary': 37300, 'valid': False} | {'points': 7380, 'reason': 'roster', 'salary': 37300, 'valid': False} | Passed |
| normal control 3 | {'points': 7044, 'reason': 'roster', 'salary': 41600, 'valid': False} | {'points': 7044, 'reason': 'roster', 'salary': 41600, 'valid': False} | Passed |
| normal control 4 | {'points': 5955, 'reason': None, 'salary': 47800, 'valid': True} | {'points': 5955, 'reason': None, 'salary': 47800, 'valid': True} | Passed |
SHA-256 / 98445c7d52bc1dc47042fc09a11ae03f24d01b74d40264093eb1e0e5ed6b9010
3 / The verified repair
Exit 0"""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: two-team requirement',
[{'CPT': 'c', 'FLEX': ['e', 'h', 'b', 'd', 'f']},
{'a': 1333, 'b': 1795, 'c': -50, 'd': 723, 'e': 382, 'f': -45, 'g': 61, 'h': -50},
{'a': 9900, 'b': 9900, 'c': 3300, 'd': 3300, 'e': 3300, 'f': 3300, 'g': 5500, 'h': 3300},
{'a': 'H', 'b': 'H', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 28200],
{'points': 2730, 'reason': None, 'salary': 28100, 'valid': True}),
('partial repair probe: two-team requirement',
[{'CPT': 'g', 'FLEX': ['b', 'a', 'e', 'c', 'd']},
{'a': 2001, 'b': 225, 'c': 225, 'd': 1333, 'e': 225, 'f': 225, 'g': 1795, 'h': 0},
{'a': 9900, 'b': 3300, 'c': 9900, 'd': 7100, 'e': 8700, 'f': 10500, 'g': 8700, 'h': 9900},
{'a': 'H', 'b': 'H', 'c': 'H', 'd': 'A', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 52100],
{'points': 6702, 'reason': None, 'salary': 52000, 'valid': True}),
('second regression',
[{'CPT': 'a', 'FLEX': ['g', 'd', 'e', 'f', 'h']},
{'a': 225, 'b': 0, 'c': 1333, 'd': 225, 'e': -50, 'f': 225, 'g': -45, 'h': 1333},
{'a': 8700, 'b': 5300, 'c': 5500, 'd': 5500, 'e': 8700, 'f': 5500, 'g': 7100, 'h': 7100},
{'a': 'A', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 50000],
{'points': 2026, 'reason': None, 'salary': 47000, 'valid': True}),
('normal control 1',
[{'CPT': 'g', 'FLEX': ['g', 'h', 'c', 'e', 'f']},
{'a': 1795, 'b': 1692, 'c': -45, 'd': -50, 'e': 0, 'f': 1795, 'g': 2759, 'h': 0},
{'a': 9900, 'b': 9900, 'c': 5500, 'd': 10500, 'e': 3300, 'f': 9900, 'g': 9900, 'h': 5500},
{'a': 'H', 'b': 'H', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 48900],
{'points': 8648, 'reason': 'roster', 'salary': 49000, 'valid': False}),
('normal control 2',
[{'CPT': 'h', 'FLEX': ['g', 'e', 'h', 'b', 'c']},
{'a': -50, 'b': 1795, 'c': 2077, 'd': -45, 'e': 225, 'f': 2001, 'g': -50, 'h': 1333},
{'a': 5300, 'b': 3300, 'c': 3300, 'd': 7100, 'e': 8700, 'f': 10500, 'g': 8700, 'h': 5300},
{'a': 'H', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'A', 'g': 'A', 'h': 'H'}, 37400],
{'points': 7380, 'reason': 'roster', 'salary': 37300, 'valid': False}),
('normal control 3',
[{'CPT': 'd', 'FLEX': ['c', 'f', 'h', 'd', 'b']},
{'a': 2001, 'b': -50, 'c': -45, 'd': 1795, 'e': 2001, 'f': 2426, 'g': 2173, 'h': 225},
{'a': 9900, 'b': 3300, 'c': 5300, 'd': 7100, 'e': 7100, 'f': 5300, 'g': 5500, 'h': 9900},
{'a': 'H', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 41700],
{'points': 7044, 'reason': 'roster', 'salary': 41600, 'valid': False}),
('normal control 4',
[{'CPT': 'e', 'FLEX': ['c', 'a', 'f', 'b', 'd']},
{'a': 2001, 'b': -45, 'c': 1333, 'd': 1333, 'e': 0, 'f': 1333, 'g': 1795, 'h': 1120},
{'a': 3300, 'b': 9900, 'c': 7100, 'd': 5500, 'e': 9900, 'f': 7100, 'g': 8700, 'h': 9900},
{'a': 'H', 'b': 'H', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'A', 'h': 'A'}, 47900],
{'points': 5955, 'reason': None, 'salary': 47800, 'valid': True})],
[('regression: two-team requirement',
[{'CPT': 'a', 'FLEX': ['d', 'f', 'b', 'c', 'h']},
{'a': 1333, 'b': -45, 'c': -45, 'd': 0, 'e': 225, 'f': 2001, 'g': 1795, 'h': 225},
{'a': 10500, 'b': 7100, 'c': 9900, 'd': 7100, 'e': 3300, 'f': 10500, 'g': 5500, 'h': 5300},
{'a': 'A', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 55800],
{'points': 4136, 'reason': None, 'salary': 55700, 'valid': True}),
('partial repair probe: two-team requirement',
[{'CPT': 'e', 'FLEX': ['a', 'd', 'c', 'h', 'g']},
{'a': 1333, 'b': 225, 'c': 225, 'd': 1795, 'e': 225, 'f': 1333, 'g': -45, 'h': 225},
{'a': 7100, 'b': 7100, 'c': 7100, 'd': 10500, 'e': 7100, 'f': 8700, 'g': 3300, 'h': 7100},
{'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'A', 'h': 'H'}, 50000],
{'points': 3871, 'reason': None, 'salary': 45800, 'valid': True}),
('second regression',
[{'CPT': 'e', 'FLEX': ['g', 'b', 'a', 'd', 'c']},
{'a': 225, 'b': -45, 'c': 2001, 'd': 2001, 'e': -50, 'f': 0, 'g': 225, 'h': 2001},
{'a': 3300, 'b': 8700, 'c': 3300, 'd': 5500, 'e': 3300, 'f': 8700, 'g': 7100, 'h': 9900},
{'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'H'}, 33000],
{'points': 4332, 'reason': None, 'salary': 32900, 'valid': True}),
('normal control 1',
[{'CPT': 'a', 'FLEX': ['d', 'f', 'a', 'c', 'g']},
{'a': 2619, 'b': -45, 'c': 2001, 'd': -50, 'e': 0, 'f': 1795, 'g': 0, 'h': -45},
{'a': 10500, 'b': 7100, 'c': 8700, 'd': 5300, 'e': 8700, 'f': 9900, 'g': 5300, 'h': 5300},
{'a': 'H', 'b': 'H', 'c': 'H', 'd': 'A', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 50000],
{'points': 10294, 'reason': 'roster', 'salary': 55500, 'valid': False}),
('normal control 2',
[{'CPT': 'a', 'FLEX': ['h', 'e', 'c', 'b', 'a']},
{'a': 2001, 'b': -50, 'c': 1795, 'd': 2020, 'e': 2001, 'f': -45, 'g': 2001, 'h': 225},
{'a': 5500, 'b': 5500, 'c': 8700, 'd': 8700, 'e': 5300, 'f': 9900, 'g': 3300, 'h': 3300},
{'a': 'A', 'b': 'A', 'c': 'A', 'd': 'A', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 36700],
{'points': 8974, 'reason': 'roster', 'salary': 36600, 'valid': False}),
('normal control 3',
[{'CPT': 'a', 'FLEX': ['d', 'h', 'b', 'f', 'a']},
{'a': 2300, 'b': 225, 'c': -50, 'd': 114, 'e': 1333, 'f': 2849, 'g': 2001, 'h': -45},
{'a': 7100, 'b': 7100, 'c': 5300, 'd': 9900, 'e': 8700, 'f': 7100, 'g': 5300, 'h': 5500},
{'a': 'H', 'b': 'H', 'c': 'H', 'd': 'A', 'e': 'H', 'f': 'A', 'g': 'H', 'h': 'A'}, 47400],
{'points': 8893, 'reason': 'roster', 'salary': 47400, 'valid': False}),
('normal control 4',
[{'CPT': 'd', 'FLEX': ['c', 'h', 'a', 'f', 'e']},
{'a': 225, 'b': 1795, 'c': 2001, 'd': -50, 'e': 472, 'f': 225, 'g': 1333, 'h': 225},
{'a': 7100, 'b': 7100, 'c': 7100, 'd': 8700, 'e': 7100, 'f': 5300, 'g': 10500, 'h': 5300},
{'a': 'H', 'b': 'A', 'c': 'A', 'd': 'A', 'e': 'A', 'f': 'H', 'g': 'A', 'h': 'A'}, 50000],
{'points': 3073, 'reason': None, 'salary': 45000, 'valid': True})],
[('regression: two-team requirement',
[{'CPT': 'e', 'FLEX': ['f', 'd', 'c', 'a', 'h']},
{'a': -50, 'b': 2001, 'c': -50, 'd': 0, 'e': -45, 'f': 2001, 'g': -45, 'h': 1333},
{'a': 5300, 'b': 8700, 'c': 10500, 'd': 8700, 'e': 5300, 'f': 8700, 'g': 8700, 'h': 5500},
{'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'H'}, 50000],
{'points': 3166, 'reason': None, 'salary': 46700, 'valid': True}),
('partial repair probe: two-team requirement',
[{'CPT': 'd', 'FLEX': ['f', 'g', 'h', 'a', 'e']},
{'a': -45, 'b': -45, 'c': 2014, 'd': 1795, 'e': 1333, 'f': -50, 'g': 0, 'h': -50},
{'a': 5500, 'b': 5300, 'c': 7100, 'd': 3300, 'e': 7100, 'f': 5500, 'g': 10500, 'h': 3300},
{'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'H'}, 50000],
{'points': 3881, 'reason': None, 'salary': 36900, 'valid': True}),
('second regression',
[{'CPT': 'c', 'FLEX': ['h', 'f', 'g', 'b', 'a']},
{'a': -50, 'b': 821, 'c': 225, 'd': 1795, 'e': 1333, 'f': 1333, 'g': 1333, 'h': 2001},
{'a': 7100, 'b': 10500, 'c': 8700, 'd': 8700, 'e': 8700, 'f': 10500, 'g': 5500, 'h': 5500},
{'a': 'H', 'b': 'H', 'c': 'A', 'd': 'A', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 52200],
{'points': 5776, 'reason': None, 'salary': 52200, 'valid': True}),
('normal control 1',
[{'CPT': 'c', 'FLEX': ['b', 'c', 'f', 'a', 'g']},
{'a': 1795, 'b': 0, 'c': 1795, 'd': 0, 'e': 1795, 'f': 103, 'g': -50, 'h': 1795},
{'a': 5300, 'b': 10500, 'c': 5300, 'd': 7100, 'e': 3300, 'f': 8700, 'g': 8700, 'h': 5500},
{'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'A', 'h': 'H'}, 46500],
{'points': 6336, 'reason': 'roster', 'salary': 46500, 'valid': False}),
('normal control 2',
[{'CPT': 'e', 'FLEX': ['e', 'b', 'g', 'd', 'h']},
{'a': 1660, 'b': 0, 'c': 1684, 'd': 1228, 'e': 1795, 'f': -50, 'g': 2114, 'h': 1775},
{'a': 3300, 'b': 3300, 'c': 9900, 'd': 9900, 'e': 9900, 'f': 9900, 'g': 8700, 'h': 3300},
{'a': 'A', 'b': 'H', 'c': 'H', 'd': 'A', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 50100],
{'points': 9605, 'reason': 'roster', 'salary': 50000, 'valid': False}),
('normal control 3',
[{'CPT': 'd', 'FLEX': ['f', 'h', 'b', 'c', 'd']},
{'a': 1861, 'b': 104, 'c': 225, 'd': 1333, 'e': 2001, 'f': -45, 'g': -45, 'h': 1795},
{'a': 3300, 'b': 3300, 'c': 7100, 'd': 9900, 'e': 7100, 'f': 10500, 'g': 8700, 'h': 5300},
{'a': 'H', 'b': 'A', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'A', 'h': 'H'}, 51100],
{'points': 5412, 'reason': 'roster', 'salary': 51000, 'valid': False}),
('normal control 4',
[{'CPT': 'h', 'FLEX': ['a', 'f', 'b', 'g', 'c']},
{'a': 0, 'b': 1333, 'c': 1795, 'd': 1795, 'e': 0, 'f': 2001, 'g': 225, 'h': 225},
{'a': 9900, 'b': 10500, 'c': 9900, 'd': 8700, 'e': 10500, 'f': 9900, 'g': 5500, 'h': 9900},
{'a': 'H', 'b': 'H', 'c': 'A', 'd': 'A', 'e': 'H', 'f': 'H', 'g': 'A', 'h': 'A'}, 50000],
{'points': 5692, 'reason': 'cap', 'salary': 60600, 'valid': False})],
[('regression: two-team requirement',
[{'CPT': 'c', 'FLEX': ['d', 'h', 'a', 'e', 'g']},
{'a': 1333, 'b': 225, 'c': 1333, 'd': 225, 'e': 2911, 'f': 1333, 'g': -50, 'h': 225},
{'a': 8700, 'b': 5500, 'c': 3300, 'd': 10500, 'e': 5500, 'f': 9900, 'g': 10500, 'h': 8700},
{'a': 'H', 'b': 'H', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 50000],
{'points': 6644, 'reason': None, 'salary': 48900, 'valid': True}),
('partial repair probe: two-team requirement',
[{'CPT': 'd', 'FLEX': ['e', 'f', 'a', 'b', 'h']},
{'a': 225, 'b': 1795, 'c': -80, 'd': 1333, 'e': 1700, 'f': 0, 'g': 2205, 'h': -50},
{'a': 7100, 'b': 5300, 'c': 5300, 'd': 7100, 'e': 5300, 'f': 5300, 'g': 10500, 'h': 8700},
{'a': 'H', 'b': 'H', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'A', 'h': 'A'}, 42500],
{'points': 5670, 'reason': None, 'salary': 42400, 'valid': True}),
('second regression',
[{'CPT': 'h', 'FLEX': ['a', 'g', 'b', 'd', 'f']},
{'a': 2001, 'b': -50, 'c': -50, 'd': 1333, 'e': 1333, 'f': 225, 'g': -45, 'h': -45},
{'a': 9900, 'b': 8700, 'c': 7100, 'd': 7100, 'e': 5500, 'f': 9900, 'g': 10500, 'h': 7100},
{'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'A'}, 56800],
{'points': 3396, 'reason': None, 'salary': 56800, 'valid': True}),
('normal control 1',
[{'CPT': 'a', 'FLEX': ['g', 'h', 'a', 'd', 'f']},
{'a': -50, 'b': 0, 'c': 225, 'd': 2048, 'e': 0, 'f': 1951, 'g': 1333, 'h': 1795},
{'a': 10500, 'b': 7100, 'c': 8700, 'd': 3300, 'e': 9900, 'f': 10500, 'g': 10500, 'h': 10500},
{'a': 'H', 'b': 'A', 'c': 'A', 'd': 'H', 'e': 'A', 'f': 'H', 'g': 'H', 'h': 'A'}, 61200],
{'points': 7002, 'reason': 'roster', 'salary': 61100, 'valid': False}),
('normal control 2',
[{'CPT': 'h', 'FLEX': ['b', 'h', 'c', 'e', 'g']},
{'a': -45, 'b': 2001, 'c': 225, 'd': 1333, 'e': -50, 'f': -45, 'g': -50, 'h': 2001},
{'a': 5500, 'b': 5500, 'c': 5300, 'd': 9900, 'e': 9900, 'f': 5500, 'g': 5300, 'h': 9900},
{'a': 'H', 'b': 'H', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 50800],
{'points': 7129, 'reason': 'roster', 'salary': 50800, 'valid': False}),
('normal control 3',
[{'CPT': 'a', 'FLEX': ['f', 'c', 'e', 'h', 'b']},
{'a': -45, 'b': 2001, 'c': 2001, 'd': 0, 'e': 2001, 'f': 1795, 'g': 225, 'h': -45},
{'a': 9900, 'b': 5300, 'c': 9900, 'd': 7100, 'e': 9900, 'f': 8700, 'g': 10500, 'h': 10500},
{'a': 'H', 'b': 'H', 'c': 'A', 'd': 'A', 'e': 'H', 'f': 'A', 'g': 'H', 'h': 'A'}, 50000],
{'points': 7685, 'reason': 'cap', 'salary': 59200, 'valid': False}),
('normal control 4',
[{'CPT': 'f', 'FLEX': ['b', 'f', 'a', 'h', 'c']},
{'a': 1333, 'b': 2001, 'c': 1886, 'd': 1795, 'e': 1390, 'f': 225, 'g': 0, 'h': 225},
{'a': 10500, 'b': 5300, 'c': 5500, 'd': 8700, 'e': 8700, 'f': 3300, 'g': 7100, 'h': 7100},
{'a': 'A', 'b': 'H', 'c': 'A', 'd': 'H', 'e': 'H', 'f': 'A', 'g': 'H', 'h': 'A'}, 36600],
{'points': 6008, 'reason': 'roster', 'salary': 36700, 'valid': False})],
[('regression: two-team requirement',
[{'CPT': 'b', 'FLEX': ['h', 'd', 'a', 'g', 'c']},
{'a': 1652, 'b': 0, 'c': 2001, 'd': 2001, 'e': -50, 'f': 2001, 'g': 0, 'h': -45},
{'a': 5300, 'b': 8700, 'c': 10500, 'd': 8700, 'e': 5500, 'f': 8700, 'g': 10500, 'h': 5500},
{'a': 'H', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 53700],
{'points': 5609, 'reason': None, 'salary': 53600, 'valid': True}),
('partial repair probe: two-team requirement',
[{'CPT': 'g', 'FLEX': ['b', 'd', 'f', 'c', 'h']},
{'a': 1840, 'b': 1333, 'c': 2671, 'd': -50, 'e': -50, 'f': 2001, 'g': -45, 'h': -45},
{'a': 7100, 'b': 3300, 'c': 5500, 'd': 10500, 'e': 10500, 'f': 10500, 'g': 8700, 'h': 7100},
{'a': 'H', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'A'}, 50000],
{'points': 5842, 'reason': None, 'salary': 50000, 'valid': True}),
('second regression',
[{'CPT': 'f', 'FLEX': ['a', 'g', 'd', 'e', 'c']},
{'a': -45, 'b': -50, 'c': 2612, 'd': 225, 'e': 0, 'f': 1333, 'g': -50, 'h': -45},
{'a': 5500, 'b': 5300, 'c': 10500, 'd': 8700, 'e': 5500, 'f': 10500, 'g': 7100, 'h': 10500},
{'a': 'A', 'b': 'A', 'c': 'A', 'd': 'A', 'e': 'A', 'f': 'H', 'g': 'A', 'h': 'A'}, 53100],
{'points': 4742, 'reason': None, 'salary': 53100, 'valid': True}),
('normal control 1',
[{'CPT': 'c', 'FLEX': ['b', 'a', 'd', 'h', 'f']},
{'a': -50, 'b': 267, 'c': 2001, 'd': 2001, 'e': 225, 'f': -45, 'g': -50, 'h': 0},
{'a': 7100, 'b': 9900, 'c': 9900, 'd': 8700, 'e': 9900, 'f': 5500, 'g': 9900, 'h': 5300},
{'a': 'A', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 51400],
{'points': 5175, 'reason': None, 'salary': 51400, 'valid': True}),
('normal control 2',
[{'CPT': 'b', 'FLEX': ['g', 'e', 'b', 'h', 'c']},
{'a': 0, 'b': 1333, 'c': 1333, 'd': 2912, 'e': 1333, 'f': 225, 'g': 0, 'h': -50},
{'a': 5500, 'b': 8700, 'c': 9900, 'd': 5300, 'e': 7100, 'f': 3300, 'g': 5300, 'h': 3300},
{'a': 'A', 'b': 'A', 'c': 'H', 'd': 'H', 'e': 'A', 'f': 'A', 'g': 'H', 'h': 'H'}, 47400],
{'points': 5949, 'reason': 'roster', 'salary': 47400, 'valid': False}),
('normal control 3',
[{'CPT': 'b', 'FLEX': ['a', 'e', 'c', 'h', 'f']},
{'a': 2001, 'b': 1795, 'c': 582, 'd': 1795, 'e': -45, 'f': -45, 'g': -45, 'h': 215},
{'a': 3300, 'b': 7100, 'c': 9900, 'd': 5300, 'e': 10500, 'f': 7100, 'g': 7100, 'h': 10500},
{'a': 'H', 'b': 'H', 'c': 'H', 'd': 'A', 'e': 'A', 'f': 'H', 'g': 'A', 'h': 'A'}, 52000],
{'points': 5401, 'reason': None, 'salary': 52000, 'valid': True}),
('normal control 4',
[{'CPT': 'b', 'FLEX': ['a', 'g', 'e', 'h', 'c']},
{'a': 1795, 'b': 2582, 'c': 1795, 'd': -45, 'e': -50, 'f': 2001, 'g': 225, 'h': -45},
{'a': 7100, 'b': 5300, 'c': 7100, 'd': 7100, 'e': 7100, 'f': 10500, 'g': 5300, 'h': 9900},
{'a': 'A', 'b': 'H', 'c': 'H', 'd': 'H', 'e': 'H', 'f': 'H', 'g': 'H', 'h': 'H'}, 44400],
{'points': 7593, 'reason': 'cap', 'salary': 44500, '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: two-team requirement | {'points': 2730, 'reason': None, 'salary': 28100, 'valid': True} | {'points': 2730, 'reason': None, 'salary': 28100, 'valid': True} | Passed |
| partial repair probe: two-team requirement | {'points': 6702, 'reason': None, 'salary': 52000, 'valid': True} | {'points': 6702, 'reason': None, 'salary': 52000, 'valid': True} | Passed |
| second regression | {'points': 2026, 'reason': None, 'salary': 47000, 'valid': True} | {'points': 2026, 'reason': None, 'salary': 47000, 'valid': True} | Passed |
| normal control 1 | {'points': 8648, 'reason': 'roster', 'salary': 49000, 'valid': False} | {'points': 8648, 'reason': 'roster', 'salary': 49000, 'valid': False} | Passed |
| normal control 2 | {'points': 7380, 'reason': 'roster', 'salary': 37300, 'valid': False} | {'points': 7380, 'reason': 'roster', 'salary': 37300, 'valid': False} | Passed |
| normal control 3 | {'points': 7044, 'reason': 'roster', 'salary': 41600, 'valid': False} | {'points': 7044, 'reason': 'roster', 'salary': 41600, 'valid': False} | Passed |
| normal control 4 | {'points': 5955, 'reason': None, 'salary': 47800, 'valid': True} | {'points': 5955, 'reason': None, 'salary': 47800, 'valid': True} | Passed |
SHA-256 / a4a079b969bfada5bf3db0dc4fe29d9c88c6671d779e3da97bd3edaed711ed59
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.098276+00:00.
Case digest / 73d81f6ebd7ec3f568bbab83e29de40f9a741f4e8f8fc6343253cf8a664919bd