# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1029069 | 2024-07-20T11:57:10 Z | 42kangaroo | 드문 곤충 (IOI22_insects) | C++17 | 34 ms | 824 KB |
#include "insects.h" #include "bits/stdc++.h" using namespace std; int min_cardinality(int N) { set<int> inside, outside; for (int i = 0; i < N; ++i) { move_inside(i); if (press_button() > 1) { outside.insert(i); move_outside(i); } else { inside.insert(i); } } int k = inside.size(); int l = 1, r = N/k + 1; while (l + 1 < r) { int m = (l + r + 1)/2; set<int> nIn, nOut; for (auto e: outside) { move_inside(e); if (press_button() > m) { nOut.insert(e); move_outside(e); } else nIn.insert(e); } if ((inside.size() + nIn.size()) == m*k) { l = m; outside = nOut; } else { r = m; for (auto e: nIn) { move_outside(e); } outside = nIn; } } return l; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 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 | Incorrect | 5 ms | 344 KB | Wrong answer. |
7 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 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 | Incorrect | 5 ms | 344 KB | Wrong answer. |
7 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 344 KB | Output is correct |
2 | Correct | 0 ms | 344 KB | Output is correct |
3 | Correct | 1 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 | 0 ms | 344 KB | Output is correct |
7 | Incorrect | 34 ms | 824 KB | Wrong answer. |
8 | Halted | 0 ms | 0 KB | - |