# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
796186 | ln_e | Rarest Insects (IOI22_insects) | C++17 | 1 ms | 208 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 <bits/stdc++.h> //Andrei Alexandru a.k.a Sho
#include "insects.h"
using ll=long long;
using ld=long double;
int const INF=1000000005;
ll const LINF=1000000000000000005;
ll const mod=1000000007;
ld const PI=3.14159265359;
ll const MAX_N=3e5+5;
ld const EPS=0.00000001;
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#define f first
#define s second
#define pb push_back
#define mp make_pair
#define endl '\n'
#define sz(a) (int)a.size()
#define CODE_START ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
int min_cardinality(int N) {
vector<ll>v;
for(ll i=0;i<N;i++)
{
v.pb(i);
move_inside(i);
}
while(1!=0){
int x=press_button();
if(x==1){
return 1;
}
if(x==v.size()){
return x;
}else {
vector<int>remove;
while(press_button()==x&&v.size()>=1){
//cout<<v.back()<<endl;
move_outside(v.back());
remove.pb(v.back());
v.pop_back();
}
for(ll i=0;i<remove.size()-1;i++)
{
v.pb(remove[i]);
}
}
}
}
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... |