mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-11-24 09:28:49 +00:00
P1947 猜数
R43654062
This commit is contained in:
parent
94c2a7cb43
commit
8cd137f0cc
17
problem/P1947/P1947.cpp
Normal file
17
problem/P1947/P1947.cpp
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
extern "C" int Seniorious(int);
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
l = mid + 1;
|
||||||
|
}
|
||||||
|
mid = l + r >> 1;
|
||||||
|
}
|
||||||
|
return ans;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user