Submission #1024471

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
10244712024-07-16 05:40:01vjudge1Rarest Insects (IOI22_insects)C++17
47.98 / 100
174 ms1112 KiB
#include <bits/stdc++.h>
#define ent '\n'
void move_inside(int i);
void move_outside(int i);
int press_button();
using namespace std;
typedef long long ll;
const int maxn = 1e5 + 12;
struct Q{
int mid, l, r, i;
};
int cnt[maxn];
bool is[maxn];
int p[maxn];
int min_cardinality(int n){
vector<Q> q;
vector<int> v;
for(int i=0;i<n;i++){
move_inside(i);
if(press_button() != 1){
move_outside(i);
int l = 0, r = i - 1, mid = l + r >> 1;
q.push_back({mid, l, r, i});
}
else{
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

insects.cpp: In function 'int min_cardinality(int)':
insects.cpp:27:43: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   27 |             int l = 0, r = i - 1, mid = l + r >> 1;
      |                                         ~~^~~
insects.cpp:63:30: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   63 |                 int nmid = l + r >> 1;
      |                            ~~^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...