Submission #1232184

#TimeUsernameProblemLanguageResultExecution timeMemory
1232184dssfsuper2Rarest Insects (IOI22_insects)C++20
Compilation error
0 ms0 KiB
#include "insects.h" #include <bits/stdc++.h> using namespace std; set<int> ls; void tomf(int nv){ } int min_cardinality(int N) { vector<int> representatives; vector<vector<int>> groups; groups.push_back({0}); move_inside(0); for(int i = 1;i<N;i++){ move_inside(i); int x = press_button(); if (x==1){ groups.push_back({i}); } else{ for(int j = 0;j<groups.size();j++){ auto thing = groups[j]; move_outside(thing.back()); int x = press_button(); if (x==1){ groups[j].push_back(i); break; } else{ move_inside(thing.back()); } } } int t = 1000000000; for(auto thing:groups){ t=min(t, (int)thing.size()); } return t; }

Compilation message (stderr)

insects.cpp: In function 'int min_cardinality(int)':
insects.cpp:41:2: error: expected '}' at end of input
   41 | }
      |  ^
insects.cpp:10:28: note: to match this '{'
   10 | int min_cardinality(int N) {
      |                            ^
insects.cpp:41:2: warning: control reaches end of non-void function [-Wreturn-type]
   41 | }
      |  ^