답안 #858737

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
858737 2023-10-09T05:51:17 Z temporary1 드문 곤충 (IOI22_insects) C++17
10 / 100
218 ms 1236 KB
#include "insects.h"
#include <bits/stdc++.h>
using namespace std;

int cnt;
set<int> st;
vector<int> due;

int min_cardinality(int n) {
    move_inside(0);
    cnt = 1;
    int k;
    for (int i = 1; i < n; ++i) {
        move_inside(i);
        k = press_button();
        if (k == 1) {
            ++cnt;
        } else {
            move_outside(i);
            st.insert(i);
        }
    }
    if (cnt == 1) {
      return n;
    }
    int max1 = (n-k)/(cnt-1);
    for (int i = 2; i <= max1; ++i) {
        int curcnt = 0;
        /*printf("%d\n",i);
        for (auto it : st) {
          printf("%d ",it);
        }
        printf("\n");*/
        for (auto it : st) {
            move_inside(it);
            if (press_button() == i) {
                due.push_back(it);
                ++curcnt;
            } else {
                move_outside(it);
            }
        }
        if (curcnt < cnt) {
            return i-1;
        }
        for (auto it : due) {
          st.erase(it);
        }
    }
    return max1;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 0 ms 344 KB Output is correct
5 Correct 0 ms 344 KB Output is correct
6 Correct 1 ms 344 KB Output is correct
7 Correct 1 ms 344 KB Output is correct
8 Correct 7 ms 344 KB Output is correct
9 Correct 4 ms 344 KB Output is correct
10 Correct 2 ms 344 KB Output is correct
11 Correct 1 ms 344 KB Output is correct
12 Correct 2 ms 344 KB Output is correct
13 Correct 2 ms 600 KB Output is correct
14 Correct 18 ms 440 KB Output is correct
15 Correct 11 ms 600 KB Output is correct
16 Correct 12 ms 600 KB Output is correct
17 Correct 7 ms 688 KB Output is correct
18 Correct 3 ms 852 KB Output is correct
19 Correct 3 ms 340 KB Output is correct
20 Correct 3 ms 852 KB Output is correct
21 Correct 1 ms 344 KB Output is correct
22 Correct 1 ms 600 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 0 ms 344 KB Output is correct
5 Correct 0 ms 344 KB Output is correct
6 Correct 1 ms 344 KB Output is correct
7 Correct 1 ms 344 KB Output is correct
8 Correct 7 ms 344 KB Output is correct
9 Correct 4 ms 344 KB Output is correct
10 Correct 2 ms 344 KB Output is correct
11 Correct 1 ms 344 KB Output is correct
12 Correct 2 ms 344 KB Output is correct
13 Correct 2 ms 600 KB Output is correct
14 Correct 18 ms 440 KB Output is correct
15 Correct 11 ms 600 KB Output is correct
16 Correct 12 ms 600 KB Output is correct
17 Correct 7 ms 688 KB Output is correct
18 Correct 3 ms 852 KB Output is correct
19 Correct 3 ms 340 KB Output is correct
20 Correct 3 ms 852 KB Output is correct
21 Correct 1 ms 344 KB Output is correct
22 Correct 1 ms 600 KB Output is correct
23 Correct 4 ms 728 KB Output is correct
24 Correct 5 ms 344 KB Output is correct
25 Correct 84 ms 856 KB Output is correct
26 Correct 66 ms 1104 KB Output is correct
27 Correct 9 ms 624 KB Output is correct
28 Correct 6 ms 596 KB Output is correct
29 Correct 15 ms 852 KB Output is correct
30 Correct 10 ms 868 KB Output is correct
31 Incorrect 218 ms 956 KB Too many queries.
32 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 1 ms 344 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 0 ms 344 KB Output is correct
5 Correct 1 ms 344 KB Output is correct
6 Correct 0 ms 344 KB Output is correct
7 Correct 11 ms 1236 KB Output is correct
8 Correct 8 ms 344 KB Output is correct
9 Incorrect 184 ms 1112 KB Too many queries.
10 Halted 0 ms 0 KB -