Submission #1074364

#TimeUsernameProblemLanguageResultExecution timeMemory
1074364NicolaikrobRarest Insects (IOI22_insects)C++17
10 / 100
275 ms596 KiB
#include "insects.h" #include <bits/stdc++.h> using namespace std; typedef vector<int> vi; int min_cardinality(int n) { vi T(n), C(n, 1); for(int i = 0; i < n; i++) T[i] = i; for(int i = 0; i < n-1; i++) { if(T[i] != i) continue; move_inside(i); for(int j = i+1; j < n; j++) { if(T[i] != i) continue; move_inside(j); int t = press_button(); if(t == 2) T[j] = T[i], C[i]++, C[j] = n; move_outside(j); } move_outside(i); } int mn = n; for(auto x : C) mn = min(x, mn); return mn; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...