0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-12-26 16:52:40 +00:00
OI-codes/Luogu/P1947/P1947.cpp

18 lines
347 B
C++
Raw Normal View History

2020-12-13 08:31:18 +00:00
extern "C" int Seniorious(int);
2022-05-20 01:23:27 +00:00
2020-12-13 08:31:18 +00:00
extern "C" int Chtholly(int n, int OvO) {
int ans = 1;
int l = 1, r = n;
int mid = l + r >> 1;
while (l <= r) {
if (Seniorious(mid) >= 0) {
ans = mid;
r = mid - 1;
2021-11-19 09:01:13 +00:00
} else {
2020-12-13 08:31:18 +00:00
l = mid + 1;
}
mid = l + r >> 1;
}
return ans;
}