系统信息
Exited with return code 0
编号 | 题目 | 状态 | 分数 | 总时间 | 内存 | 代码 / 答案文件 | 提交者 | 提交时间 |
---|---|---|---|---|---|---|---|---|
#80812 | #1028. 小秋的完美数字 | Accepted | 100 | 17 ms | 364 K | C++ 17 / 268 B | 规培005 贺晓珉 | 2022-08-02 15:36:24 |
#include <bits/stdc++.h>
using namespace std;
int o;
int main() {
int l = 1, r = 1e9;
while (l <= r) {
int m = (l + r) >> 1;
cout << m << endl;
fflush(stdout);
cin >> o;
if (o == 0)
return 0;
if (o == -1)
l = m + 1;
else
r = m - 1;
}
return 0;
}