Submission #1051554

# Submission time Handle Problem Language Result Execution time Memory
1051554 2024-08-10T08:03:22 Z MercubytheFirst How to Avoid Disqualification in 75 Easy Steps (CEOI23_avoid) C++17
0 / 100
1 ms 448 KB
#include "avoid.h"
#include <bits/stdc++.h>
using namespace std;


std::pair<int, int> scout(int R, int H) {
  int l = 1, r = 1000, ans = -1;
  while(l <= r) {
    int m = (l + r) / 2;
    vector<int> query;
    for(int i = l; i <= m; ++i) {
      query.push_back(i);
    }
    send(query);
    bool ok = wait()[0];
    if(ok) {
      ans = m;
      r = m - 1;
    }
    else {
      l = m + 1;
    }
  }
  const int a = ans;
  l = 1, r = 1000, ans = -1;
  while(l <= r) {
    int m = (l + r) / 2;
    vector<int> query;
    for(int i = l; i <= m; ++i) {
      query.push_back(i);
    }
    send(query);
    bool ok = wait()[0];
    if(ok) {
      ans = m;
      l = m + 1;
    }
    else {
      r = m - 1;
    }
  }
  const int b = ans;
  assert(a != -1 and b != -1);
  return {a, b};
}
# 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 Runtime error 1 ms 448 KB Execution killed with signal 6
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 -