autogen.py 文件源码

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

项目:xgovctf 作者: alphagov 项目源码 文件源码
def get_instance_number(pid, tid):
    """
    Maps the token to an instance number for a prolem.

    Args:
        pid: the problem id
        tid: the team id
    Returns:
        The instance number
    """

    previous_state = seed_generator(tid, pid)

    total_instances = get_number_of_instances(pid)
    if total_instances == 0:
        raise InternalException("{} has no instances.".format(pid))

    instance_number = random.randint(0, total_instances-1)
    random.setstate(previous_state)

    return instance_number
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号