Submission #728537

# Submission time Handle Problem Language Result Execution time Memory
728537 2023-04-22T15:09:01 Z raul2008487 Rarest Insects (IOI22_insects) C++17
0 / 100
1 ms 208 KB
#include "insects.h"

int min_cardinality(int N) {
    bool fl[N];
    int i,j,cur=0,ans=0,mini=N,query=0;
    for(i=0;i<N-1;i++){
        if(fl[i]){
            continue;
        }
            fl[i]=true;
            move_inside(i);
            cur=1;
            for(j=i+1;j<N;j++){
                if(!fl[j]){
                    fl[j]=true;
                    move_inside(j);
                    cur++;
                    query=press_button();
                    if(query!=cur){
                        cur--;
                    }
                    move_outside(j);
                }
            }
            
        if(cur<mini){
            mini=cur;
            ans=i;
        }
        if(mini==1){
            return ans;
        }
        move_outside(i);
    }
    return ans;
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 208 KB Wrong answer.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 208 KB Wrong answer.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 208 KB Output is correct
2 Incorrect 0 ms 208 KB Wrong answer.
3 Halted 0 ms 0 KB -