This paper investigates a cell-free massive multiple-input multiple-output (MIMO)-aided binary task offloading mobile edge computing (MEC) system. The goal is to optimize computation task processing for user equipment (UE). We formulate an optimization problem for jointly allocating computation and communication resources under a power constraint. The objective is to minimize weighted energy consumption subject to a maximum delay constraint. We simplify the original problem and transform it into an NP-hard problem under fractional non-convex constraints. A heuristic scheme is proposed based on a genetic algorithm (GA) and alternating iterations. Simulation results show that the proposed algorithm significantly reduces energy consumption in task processing.