0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-12-27 10:11:58 +00:00
OI-codes/LibreOJ/6/data/std.cpp

22 lines
320 B
C++
Raw Normal View History

2022-05-28 12:25:28 +00:00
#include "interaction.h"
inline int solve(int i) {
int l = 0, r = 1000000;
while (l < r) {
int mid = l + (r - l) / 2;
if (guess(i, mid) >= 0) r = mid;
else l = mid + 1;
}
return l;
}
int main() {
int n = get_num();
std::vector<int> a(n);
for (int i = 0; i < n; i++) {
a[i] = solve(i);
}
submit(a);
}