Submission #630007

#TimeUsernameProblemLanguageResultExecution timeMemory
630007il9Rarest Insects (IOI22_insects)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "insects using namespace std; int min_cardinality(int n) { for(int i =0;i<n;i++) { move_inside(i); } for(int i=0;i<n;i++) move_outside(i); int low=1; int high=press_button(); int mid; bool inside[n]; for(int i=0;i<n;i++) { inside[i]=0; } while(low<high) { mid=(low+high)/2; int addded=0; for(int i=0;i<n;i++) { if(!inside[i]) { move_inside(i); inside[i]=1; int tp=press_button(); added++; if(tp>mid) { inside[i]=0; added--; move_outside(i); } } } if(n-added%mid==0) { low=mid+1; }else { high=mid; for(int i=0;i<n;i++) { inside[i]=0; } } } return high; }

Compilation message (stderr)

insects.cpp:2:10: warning: missing terminating " character
    2 | #include "insects
      |          ^
insects.cpp:2:10: error: #include expects "FILENAME" or <FILENAME>
    2 | #include "insects
      |          ^~~~~~~~
insects.cpp: In function 'int min_cardinality(int)':
insects.cpp:8:9: error: 'move_inside' was not declared in this scope
    8 |         move_inside(i);
      |         ^~~~~~~~~~~
insects.cpp:11:26: error: 'move_outside' was not declared in this scope
   11 |     for(int i=0;i<n;i++) move_outside(i);
      |                          ^~~~~~~~~~~~
insects.cpp:13:14: error: 'press_button' was not declared in this scope
   13 |     int high=press_button();
      |              ^~~~~~~~~~~~
insects.cpp:30:17: error: 'move_inside' was not declared in this scope
   30 |                 move_inside(i);
      |                 ^~~~~~~~~~~
insects.cpp:33:17: error: 'added' was not declared in this scope; did you mean 'addded'?
   33 |                 added++;
      |                 ^~~~~
      |                 addded
insects.cpp:38:21: error: 'move_outside' was not declared in this scope
   38 |                     move_outside(i);
      |                     ^~~~~~~~~~~~
insects.cpp:44:14: error: 'added' was not declared in this scope; did you mean 'addded'?
   44 |         if(n-added%mid==0)
      |              ^~~~~
      |              addded
insects.cpp:23:13: warning: unused variable 'addded' [-Wunused-variable]
   23 |         int addded=0;
      |             ^~~~~~