async def _prepare_files(self, data: Dict[str, Any], temp_dir: str) -> Tuple[str, Dict[str, Any], Dict[str, str]]:
        """
        Process files, determine problem ID, and prepare configuration.

        Args:
            data: Dictionary containing file information
            temp_dir: Local temporary directory for file operations

        Returns:
            tuple: (problem_id, grader_config, local_files)

        Raises:
            ValueError: If problem ID cannot be determined
        """
        # Extract problem ID
        problem_id = None
        graders_files = []
        for file in data["files"]:
            if file["name"].startswith("graders/") and file["name"].endswith(".cpp"):
                potential_id = os.path.basename(file["name"]).split(".")[0]
                if potential_id not in ["grader", "manager", "stub"]:
                    problem_id = potential_id

            if file["name"].startswith("graders/"):
                graders_files.append(file)

        if not problem_id:
            raise ValueError("Could not determine problem ID from files")

        grader_config = {
            "task_type": "Batch",
            "code": problem_id,
            "time_limit": data["run_timeout"] / 1000,
            "memory_limit": data["run_memory_limit"] * 1024 * 1024,
        }

        for file in graders_files:
            if "manager.cpp" in file["name"]:
                grader_config["task_type"] = "Communication"
                grader_config["task_type_parameters_Communication_num_processes"] = 1
                grader_config["task_type_parameters_Communication_user_io"] = "std_io"
                break

        config_path = os.path.join(temp_dir, "grader_config.json")
        with open(config_path, "w") as f:
            json.dump(grader_config, f)

        local_files = {"grader_config.json": config_path}

        for file in data["files"]:
            local_path = os.path.join(temp_dir, os.path.basename(file["name"]))
            with open(local_path, "w") as f:
                f.write(file["content"])
            local_files[file["name"]] = local_path

        return problem_id, grader_config, local_files

        Process files, determine problem ID, and prepare configuration.

        Args:
            data: Dictionary containing file information
            temp_dir: Local temporary directory for file operations

        Returns:
            tuple: (problem_id, grader_config, local_files)

        Raises:
            ValueError: If problem ID cannot be determined
        
src/open_r1/utils/competitive_programming/morph_client.py