Submission #1078262

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
10782622024-08-27 14:37:12allin27xRarest Insects (IOI22_insects)C++17
0 / 100
57 ms592 KiB
#include <bits/stdc++.h>
#include "insects.h"
using namespace std;
#define int long long
//void move_inside(int)
//void move_outside(int)
// int press_button()
signed min_cardinality(signed N){
std::random_device rd;
std::mt19937 g(rd());
vector<int> bad(N,0);
vector<int> prm(N); iota(prm.begin(), prm.end(), 0);
for (int i=0; i<20; i++) {
shuffle(prm.begin(), prm.end(), g);
int last = 0;
for (int i=0; i<N; i++) {
move_inside(prm[i]);
int r = press_button();
if (r != last) bad[prm[i]] ++;
last = r;
}
shuffle(prm.begin(), prm.end(), g);
for (int i=0; i<N; i++) {
move_outside(prm[i]);
int r = press_button();
if (r != last) bad[prm[i]] ++;
last = r;
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

insects.cpp: In function 'int min_cardinality(int)':
insects.cpp:37:14: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<std::pair<long long int, long long int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   37 |     while (r != w.size()) {
      |            ~~^~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...