Submission #652934

#TimeUsernameProblemLanguageResultExecution timeMemory
652934grtRarest Insects (IOI22_insects)C++17
Compilation error
0 ms0 KiB
#include "insects.h" //GRT_2018 #include <bits/stdc++.h> #define PB push_back #define ST first #define ND second //mt19937 rng(chrono::high_resolution_clock::now().time_since_epoch().count()); using namespace std; using ll = long long; using pi = pair<int,int>; using vi = vector<int>; const int nax = 2010; bool discarded[nax]; int baseLength(vi &v) { vi taken = {}; for(int x : v) { move_inside(x); taken.PB(x); int w = press_button(); if(w >= 2) { move_outside(x); taken.pop_back(); } } for(int x : taken) { move_outside(x); discarded[x] = true; } return (int)taken.size(); } int min_cardinality(int n) { vi allowed = {}; for(int i = 0; i < n; ++i) { allowed.PB(i); } int k = baseLength(allowed); for(int i = 2; i <= n; ++i) { allowed.clear(); for(int j = 0; j < n; ++j) { if(!dicarded[j]) { allowed.PB(j); } } int k2 = baseLength(allowed); if(k2 < k) { return i - 1; } } return n; } int main() { ios_base::sync_with_stdio(0); cin.tie(0); }

Compilation message (stderr)

insects.cpp: In function 'int min_cardinality(int)':
insects.cpp:46:29: error: 'dicarded' was not declared in this scope; did you mean 'discarded'?
   46 |                         if(!dicarded[j]) {
      |                             ^~~~~~~~
      |                             discarded