Submission #1368026

#TimeUsernameProblemLanguageResultExecution timeMemory
1368026mannshah1211Rarest Insects (IOI22_insects)C++20
10 / 100
71 ms400 KiB
#include "insects.h"

int min_cardinality(int n) {
  int mn = n + 1;
  for (int i = 0; i < n; i++) {
    move_inside(i);
    int howmany = 1;
    for (int j = 0; j < n; j++) {
      if (j == i) {
        continue;
      }
      move_inside(j);
      if (press_button() == 2) {
        howmany++;
      }
      move_outside(j);
    }
    move_outside(i);
    if (mn > howmany) {
      mn = howmany;
    }
  }
  return mn;
}
#Result Execution timeMemoryGrader output
Fetching results...
#Result Execution timeMemoryGrader output
Fetching results...
#Result Execution timeMemoryGrader output
Fetching results...