Submission #1040556

# Submission time Handle Problem Language Result Execution time Memory
1040556 2024-08-01T07:21:30 Z 우민규(#10996) How to Avoid Disqualification in 75 Easy Steps (CEOI23_avoid) C++17
10 / 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 + 1, ret + 1};
}

#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 1 ms 344 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Correct: 10 robot(s) used, 1 hour(s) passed
2 Correct 0 ms 344 KB Correct: 10 robot(s) used, 1 hour(s) passed
3 Correct 1 ms 344 KB Correct: 10 robot(s) used, 1 hour(s) passed
4 Correct 1 ms 344 KB Correct: 10 robot(s) used, 1 hour(s) passed
5 Correct 1 ms 344 KB Correct: 10 robot(s) used, 1 hour(s) passed
6 Correct 0 ms 344 KB Correct: 10 robot(s) used, 1 hour(s) passed
7 Correct 1 ms 344 KB Correct: 10 robot(s) used, 1 hour(s) passed
8 Correct 0 ms 344 KB Correct: 10 robot(s) used, 1 hour(s) passed
9 Correct 1 ms 344 KB Correct: 10 robot(s) used, 1 hour(s) passed
10 Correct 0 ms 344 KB Correct: 10 robot(s) used, 1 hour(s) passed
# 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 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 -