제출 #637443

#제출 시각아이디문제언어결과실행 시간메모리
637443Fidan드문 곤충 (IOI22_insects)C++17
0 / 100
1 ms208 KiB
#include <bits/stdc++.h> #include "insects.h" using namespace std; typedef long long ll; void move_inside(int i); void move_outside(int i); int press_button(); int min_cardinality(int n){ vector<ll> v(n, -1); v[0]=0; ll l=1; for(ll i=1; i<n; i++){ move_inside(i); for(ll j=0; j<i; j++){ move_inside(j); ll k=press_button(); move_outside(j); if(k==2) { v[i]=v[j]; break; } } move_outside(i); if(v[i]==-1) { v[i]=l; l++; } } vector<ll> c(n, 0); for(ll i=0; i<n; i++){ c[v[i]]++; } ll mn=0; for(ll i=0; i<n; i++){ if(c[mn]>c[i]) mn=i; } return c[mn]; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...