Submission #1040551

# Submission time Handle Problem Language Result Execution time Memory
1040551 2024-08-01T07:18:48 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);
  }
  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 1 ms 344 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 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 0 ms 344 KB Correct: 10 robot(s) used, 1 hour(s) passed
4 Correct 0 ms 344 KB Correct: 10 robot(s) used, 1 hour(s) passed
5 Correct 0 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 0 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 Incorrect 0 ms 344 KB Not correct
10 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 -