# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1170753 | thelegendary08 | Rarest Insects (IOI22_insects) | C++17 | 28 ms | 428 KiB |
#include "insects.h"
#include<bits/stdc++.h>
#define vi vector<int>
#define pb push_back
#define FOR(i, k, n) for(int i = k; i<n; i++)
#define f0r(i,n) for(int i = 0; i< n; i++)
#define mp make_pair
#define pii pair<int,int>
#define vb vector<bool>
#define vout(x) for(auto u : x)cout<<u<<' '; cout<<'\n';
#define push(x); move_inside(x); v[x] = 1;
#define pull(x); move_outside(x); v[x] = 0;
using namespace std;
vector<bool>v;
vi rep;
int n;
int solve(int l, int r, int y){
// cout<<y<<' '<<'y'<<'\n';
// cout<<l<<' '<<r<<'\n';
int mid = (l + r) / 2;
vb cur(n);
FOR(i, l, mid + 1){
cur[rep[i]] = 1;
}
cur[y] = 1;
f0r(i,n){
if(v[i] && (!cur[i])){pull(i);}
else if((!v[i]) && cur[i]){push(i);}
}
// vout(v);
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |