Submission #830429

# Submission time Handle Problem Language Result Execution time Memory
830429 2023-08-19T06:31:21 Z tolbi Rarest Insects (IOI22_insects) C++17
0 / 100
10 ms 300 KB
#include <bits/stdc++.h>
using namespace std;
#include "insects.h"
int min_cardinality(int N) {
    int l = 1, r = N;
    auto check = [&](int x)->bool{
        vector<int> crr;
        for (int i = 0; i < x; i++){
            crr.push_back(i);
            move_inside(i);
        }
        bool boolean=false;
        for (int i = x; i < N; i++){
            move_inside(i);
            if (press_button()>x){
                move_outside(i);
            }
            else boolean=true;
        }
        return boolean;
    };
    while (l<r){
        int mid = l+(r-l)/2;
        if (check(mid)){
            r=mid;
        }
        else {
            l=mid+1;
        }
    }
    return l;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 208 KB Output is correct
2 Correct 0 ms 208 KB Output is correct
3 Correct 0 ms 208 KB Output is correct
4 Correct 0 ms 208 KB Output is correct
5 Correct 1 ms 208 KB Output is correct
6 Correct 2 ms 300 KB Output is correct
7 Correct 10 ms 208 KB Output is correct
8 Incorrect 10 ms 208 KB Wrong answer.
9 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 208 KB Output is correct
2 Correct 0 ms 208 KB Output is correct
3 Correct 0 ms 208 KB Output is correct
4 Correct 0 ms 208 KB Output is correct
5 Correct 1 ms 208 KB Output is correct
6 Correct 2 ms 300 KB Output is correct
7 Correct 10 ms 208 KB Output is correct
8 Incorrect 10 ms 208 KB Wrong answer.
9 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 208 KB Output is correct
2 Correct 1 ms 208 KB Output is correct
3 Correct 0 ms 208 KB Output is correct
4 Correct 1 ms 208 KB Output is correct
5 Incorrect 0 ms 208 KB Wrong answer.
6 Halted 0 ms 0 KB -