Submission #745082

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
7450822023-05-19 11:33:01math_rabbit_1028Rarest Insects (IOI22_insects)C++17
100 / 100
69 ms420 KiB
#include "insects.h"
#include <bits/stdc++.h>
using namespace std;
int types = 0, ch[2020], use[2020], cnt = 0;
int min_cardinality(int N) {
// calculate types: N times
for (int i = 0; i < N; i++) {
move_inside(i);
if (press_button() >= 2) move_outside(i);
else {
ch[i] = 1;
types++;
cnt++;
use[i] = 1;
}
}
int st = 1, ed = N / types;
while (st < ed) {
int x = (st + ed + 1 + min(2, (ed - st)/10)) / 2;
for (int i = 0; i < N; i++) {
if (ch[i] == 1) continue;
move_inside(i);
if (press_button() > x) move_outside(i);
else {
use[i] = 1;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...