# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
979657 | 12345678 | Rarest Insects (IOI22_insects) | C++17 | 33 ms | 1268 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "insects.h"
#include <bits/stdc++.h>
using namespace std;
const int nx=2e3+5;
mt19937 rng(time(0));
int p[nx], cnt, sz, in[nx], t[nx], s[nx];
vector<pair<int, int>> v;
int min_cardinality(int N) {
cin.tie(NULL)->sync_with_stdio(false);
for (int i=0; i<N; i++) v.push_back({rng(), i});
sort(v.begin(), v.end());
for (int i=0; i<N; i++) p[v[i].second]=i;
for (int i=0; i<N; i++)
{
move_inside(p[i]);
if (press_button()==1) cnt++, in[i]=1, s[i]=1;
else move_outside(p[i]);
}
if (cnt==1) return N;
if (cnt==N) return 1;
int l=1, r=N/cnt;
sz=cnt;
while (l<r)
{
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |