Skip to content
Embercode
✕
Contest strategyQuick quiz

Small cases, greedy and proof

7 questions. Covers Proving to yourself that a solution is right.

Questions 1 to 5 of 7

  1. 1. An AI proposes a greedy for the exactly-k excedances problem. Its code prints the sample answer for 5 2 correctly. What should you do next?
  2. 2. The tempting greedy prints 3 2 1 for n = 3 and k = 2. How many excedances does that output have?

    Type a number.

  3. 3. Your bakery solution reads each job with this line, but the input gives each line as t d (service time, then deadline): ``cpp for (auto &[d, t] : jobs) cin >> d >> t; `` What goes wrong?
  4. 4. Which of these are proof habits the lesson teaches?

    Pick every answer that is true.

  5. 5. Your fast solution prints 1 on a small input and the brute force prints 2. Which step comes first?

5 question(s) left on this page.

Typed answers ignore extra spaces and, for most questions, capital letters.