# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
988415 | 2024-05-24T16:17:38 Z | cnn008 | Rarest Insects (IOI22_insects) | C++17 | 0 ms | 0 KB |
#include "bits/stdc++.h" using namespace std; #include "insects.h"; #ifdef N_N_C #include "debug.h" #else #define cebug(...) "Arya" #endif #define ll long long const int N=1e5+5; const int mod=1e9+7; int vis[205],cnt[205],type; int min_cardinality(int n){ for(int i=1; i<=n; i++){ if(!vis[i]){ vis[i]=++type; move_inside(i); for(int j=i+1; j<=n; j++){ move_inside(j); int val=press_buton(); if(val==2) vis[j]=type; move_outside(j); } move_outside(i); } } for(int i=1; i<=n; i++) cnt[vis[i]]++; return *min_element(cnt+1,cnt+n+1); } /** /\_/\ * (= ._.) * / >💖 \>💕 **/