Polyman Documentation - v3.1.0
    Preparing search index...

    Function solutionTimeLimit

    • Applies config.timeLimitMultipliers to the declared time limit. Java and Python are slower than C++ at the same task (JVM startup, interpreter), so a correct OK solution could get TLE locally while the problem itself is fine. The multiplier is opt-in: C++ always defaults to 1, and a config without the field behaves exactly as before. Polygon is still pushed the plain timeLimit, this only changes local runs.

      Commands call validateTimeLimitMultipliers before running anything; it is called here again so this function never returns a bad limit.

      Parameters

      • config: default

        Configuration containing timeLimit and the optional multipliers

      • solution: LocalSolution

        Solution the limit is for

      Returns SolutionTimeLimit

      Effective limit, the factor used, and the language it was found for

      If timeLimitMultipliers is invalid

      // 1000ms problem, "java": 2 -> Java solution gets 2000ms locally
      solutionTimeLimit(config, javaSolution); // { timeLimit: 2000, multiplier: 2, language: 'java' }