# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1069926 | AdamGS | Rarest Insects (IOI22_insects) | C++17 | 42 ms | 960 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;
#define rep(a, b) for(int a = 0; a < (b); ++a)
#define st first
#define nd second
#define pb push_back
#define all(a) a.begin(), a.end()
vector<int>V, usun, Q;
int n, m;
int solve(int l, int r, vector<int>czy) {
if(l==r) return l;
int mid=(l+r+1)/2;
vector<int>A, B;
rep(i, n) if(czy[i]) {
move_inside(Q[i]);
++m;
if(press_button()>mid) {
A.pb(i);
move_outside(Q[i]);
--m;
} else B.pb(i);
if(m==mid*V.size()) break;
}
if(m==mid*V.size()) {
for(auto i : B) czy[i]=0;
return solve(mid, r, czy);
}
for(auto i : A) czy[i]=0;
for(auto i : B) {
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |