Submission #1040553

# Submission time Handle Problem Language Result Execution time Memory
1040553 2024-08-01T07:20:19 Z 우민규(#10996) How to Avoid Disqualification in 75 Easy Steps (CEOI23_avoid) C++17
0 / 100
1 ms 344 KB
#include "avoid.h"
#include <bits/stdc++.h>
using namespace std;

const int n = 1000;

void my_send(function<bool(int)> f) {
  vector<int> to_send;
  for (int i = 0; i < n; ++i) {
    if (f(i)) to_send.push_back(i + 1);
  }
  send(to_send);
}

std::pair<int, int> scout(int R, int H) {
  for (int bit = 0; bit < 10; ++bit) {
    my_send([&](int x) { return x & (1 << bit); });
  }
  auto p = wait();
  int ret = 0;
  for (int i = 0; i < p.size(); ++i) {
    if (p[i]) ret |= 1 << i;
  }
  return {ret, ret};
}

#ifndef EVAL
#include "sample_grader.cpp"
#endif

Compilation message

avoid.cpp: In function 'std::pair<int, int> scout(int, int)':
avoid.cpp:21:21: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   21 |   for (int i = 0; i < p.size(); ++i) {
      |                   ~~^~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Not correct
2 Halted 0 ms 0 KB -