How to use dmoj - 1 common examples

To help you get started, we’ve selected a few dmoj examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DMOJ / docs / problem_examples / interactive / seed2 / View on Github external
from dmoj.graders.interactive import InteractiveGrader

class Grader(InteractiveGrader):
    def interact(self, case, interactor):
        N = int(case.input_data())
        guesses = 0
        guess = 0
        while guess != N:
            guess = interactor.readint(1, 2000000000)
            guesses += 1
            if guess == N:
            elif guess > N:
        return guesses <= 31


The judge component of the DMOJ: Modern Online Judge platform

Latest version published 1 year ago

Package Health Score

59 / 100
Full package analysis

Similar packages