• Kick Start Round F 2020 题解


    ATM Queue

    排序.
    (i)排在(j)前面当且仅当(lceildfrac{A_i}{X} ceil<lceildfrac{A_j}{X} ceillor(lceildfrac{A_i}{X} ceil=lceildfrac{A_j}{X} ceilland i<j)).
    自定义比较函数进行排序,复杂度为(O(Nlog N)).

    Metal Harvest

    贪心.
    从左到右枚举区间,记录前一个机器人能工作到的最晚时间.
    1.如果该时间超过当前区间右端点,则跳过.
    2.否则需要更多的机器人,从该时间和当前区间左端点取较大值的时刻,一直工作到覆盖右端点.
    需要排序,复杂度为(O(Nlog N)).

    Painters' Duel

    博弈,记忆化搜索.
    (F( ext{mask}_ ext{first}, ext{current}_ ext{first}, ext{mask}_ ext{second}, ext{current}_ ext{second}))表示先后手经过位置和当且位置分别给出的情况下先手得分.
    转移分三种情况:
    1.先手可以移动,(F( ext{mask}_ ext{first}, ext{current}_ ext{first}, ext{mask}_ ext{second}, ext{current}_ ext{second})=displaystylemax_ ext{next}(-F( ext{mask}_ ext{second}, ext{current}_ ext{second}, ext{mask}_ ext{first}cup{ ext{next}}, ext{next})));
    2.先手不可移动但后手可以移动,(F( ext{mask}_ ext{first}, ext{current}_ ext{first}, ext{mask}_ ext{second}, ext{current}_ ext{second})=-F( ext{mask}_ ext{second}, ext{current}_ ext{second}, ext{mask}_ ext{first}, ext{current}_ ext{first}));
    3.先手均不可移动,(F( ext{mask}_ ext{first}, ext{current}_ ext{first}, ext{mask}_ ext{second}, ext{current}_ ext{second})=| ext{mask}_ ext{first}|-| ext{mask}_ ext{second}|).
    看起来复杂度很高,但实际上跑得飞快.复杂度:?.

    Yeetzhee

    动态规划,期望.
    结论:最佳策略是只要不出现矛盾就开始掷下一个骰子.
    合法的状态为所有满足以下条件的序列不下降正整数序列(B):
    1.长度小于(K).
    2.(B)中第(i)大的数比(A)中第(i)大的数少.
    经测试这样的序列(B)数量应该在(6000)以内.
    (dp_B)为从(B)(A)的期望步数.
    初始状态为(dp_A=0).
    考虑转移,假设状态(B)合法的转移有(C)个,记为(dp_{B_i}(i=1,cdots,C))那么(dp_{B}=dfrac1Cdisplaystylesum_{i=1}^Cdp_{B_i}+dfrac MC).
    答案为(dp_{{}}).复杂度:?.

  • 相关阅读:
    java栈的实现
    浅谈JSON
    Java反射机制及IoC原理
    ApplicationContext之getBean方法详解
    web.xml中的contextConfigLocation的作用
    ApplicationContext的名称解释
    spring boot如何处理异步请求异常
    screen工具实现简单分析
    SO_LINGER选项的作用和意义
    gcc的异常处理机制
  • 原文地址:https://www.cnblogs.com/Heltion/p/13737851.html
Copyright © 2020-2023  润新知