Skip to content

[GUIDE] Parser

Lunna Boo edited this page Aug 2, 2026 · 7 revisions

Não tem muito mistério, é a parte de validar todo o input do usuário pra depois inicializar os valores dos structs com os argumentos já validados e tipados.

Algumas funções e em poucas linhas tá resolvido.

You have to write one program that complies with the following rules: • Global variables are forbidden! • Your program must take the following arguments (all mandatory): number_of_coders time_to_burnout time_to_compile time_to_debug time_to_refactor number_of_compiles_required dongle_cooldown scheduler ◦ number_of_coders: The number of coders and also the number of dongles. ◦ time_to_burnout (in milliseconds): If a coder did not start compiling within time_to_burnout milliseconds since the beginning of their last compile or the beginning of the simulation, they burn out. ◦ time_to_compile (in milliseconds): The time it takes for a coder to compile. During that time, they must hold two dongles. ◦ time_to_debug (in milliseconds): The time a coder will spend debugging. ◦ time_to_refactor (in milliseconds): The time a coder will spend refactoring. After completing the refactoring phase, the coder will immediately attempt to acquire dongles and start compiling again. ◦ number_of_compiles_required: If all coders have compiled at least this many times, the simulation stops. Otherwise, it stops when a coder burns out. ◦ dongle_cooldown (in milliseconds): After being released, a dongle is unavail- able until its cooldown has passed. ◦ scheduler: The arbitration policy used by dongles to decide who gets them when multiple coders request them. The value must be exactly one of: fifo or edf. fifo means First In, First Out: the dongle is granted to the coder whose request arrived first. edf means Earliest Deadline First with deadline = last_compile_start + time_to_burnout. • Each coder has a number ranging from 1 to number_of_coders. • Coder number 1 sits next to coder number number_of_coders. Any other coder number N sits between coder number N - 1 and coder number N

Clone this wiki locally