game.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:temci 作者: parttimenerd 项目源码 文件源码
def property_filter_half(cur_index: int, all: t.List[Program], property_func: t.Callable[[Program], float],
                          remove_upper_half: bool) -> bool:
    """
    Note: if the number of programs is uneven, then one program will belong to the upper and the lower half.
    """
    vals = [property_func(p) for p in all]
    cur_val = vals[cur_index]
    median = sp.median(vals)
    if (remove_upper_half and cur_val > median) or (not remove_upper_half and cur_val < median):
        return False
    return True
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号