답안 #627381

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
627381 2022-08-12T14:04:54 Z kkkkkkkk 드문 곤충 (IOI22_insects) C++17
10 / 100
260 ms 208 KB
#include "insects.h"
#include <bits/stdc++.h>

using namespace std;

int min_cardinality(int n)
{
    int pos[n]={0},type=1;
    for (int i=0;i<n;i++)
    {
        if (pos[i]!=0)
            continue;
        pos[i]=type;
        move_inside(i);
        for (int j=i+1;j<n;j++)
        {
            if (pos[j]!=0)
                continue;
            move_inside(j);
            int p=press_button();
            if (p==2)
                pos[j]=type;
            move_outside(j);
        }
        move_outside(i);
        type++;
    }
    sort(pos,pos+n);
    int rarest=INT_MAX,following=1;
    for (int i=1;i<n;i++)
    {
        if (pos[i]!=pos[i-1])
            rarest=min(rarest,following),following=1;
        else
            following++;
    }
    rarest=min(rarest,following);
    return rarest;
}
# 결과 실행 시간 메모리 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 1 ms 208 KB Output is correct
5 Correct 1 ms 208 KB Output is correct
6 Correct 2 ms 208 KB Output is correct
7 Correct 148 ms 208 KB Output is correct
8 Correct 10 ms 208 KB Output is correct
9 Correct 13 ms 208 KB Output is correct
10 Correct 3 ms 208 KB Output is correct
11 Correct 41 ms 208 KB Output is correct
12 Correct 3 ms 208 KB Output is correct
13 Correct 12 ms 208 KB Output is correct
14 Correct 6 ms 208 KB Output is correct
15 Correct 7 ms 208 KB Output is correct
16 Correct 9 ms 208 KB Output is correct
17 Correct 14 ms 208 KB Output is correct
18 Correct 14 ms 208 KB Output is correct
19 Correct 19 ms 208 KB Output is correct
20 Correct 34 ms 208 KB Output is correct
21 Correct 67 ms 208 KB Output is correct
22 Correct 90 ms 208 KB Output is correct
# 결과 실행 시간 메모리 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 1 ms 208 KB Output is correct
5 Correct 1 ms 208 KB Output is correct
6 Correct 2 ms 208 KB Output is correct
7 Correct 148 ms 208 KB Output is correct
8 Correct 10 ms 208 KB Output is correct
9 Correct 13 ms 208 KB Output is correct
10 Correct 3 ms 208 KB Output is correct
11 Correct 41 ms 208 KB Output is correct
12 Correct 3 ms 208 KB Output is correct
13 Correct 12 ms 208 KB Output is correct
14 Correct 6 ms 208 KB Output is correct
15 Correct 7 ms 208 KB Output is correct
16 Correct 9 ms 208 KB Output is correct
17 Correct 14 ms 208 KB Output is correct
18 Correct 14 ms 208 KB Output is correct
19 Correct 19 ms 208 KB Output is correct
20 Correct 34 ms 208 KB Output is correct
21 Correct 67 ms 208 KB Output is correct
22 Correct 90 ms 208 KB Output is correct
23 Correct 8 ms 208 KB Output is correct
24 Incorrect 248 ms 208 KB Too many queries.
25 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 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 0 ms 208 KB Output is correct
6 Correct 1 ms 208 KB Output is correct
7 Correct 20 ms 208 KB Output is correct
8 Incorrect 260 ms 208 KB Too many queries.
9 Halted 0 ms 0 KB -