# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
726324 | ismayil | Rarest Insects (IOI22_insects) | C++17 | 385 ms | 296 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#pragma GCC optimize("O3")
#include "insects.h"
#include <bits/stdc++.h>
using namespace std;
//g++ -std=c++17 insects.cpp stub.cpp
int min_cardinality(int N) {
vector<int> in;
for(int j = 0; j < N; j++){
move_inside(j);
if(press_button() > 1){
move_outside(j);
}else{
in.push_back(j);
}
}
int D = in.size();
while(!in.empty()) move_outside(in.back()), in.pop_back();
for(int i = 2; i <= N; i++){
vector<int> in;
for(int j = 0; j < N; j++){
move_inside(j);
if(press_button() > i){
move_outside(j);
}else{
in.push_back(j);
}
}
if(in.size() < i * D){
return i - 1;
}
while(!in.empty()) move_outside(in.back()), in.pop_back();
}
return N;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |