系统信息
Exited with return code 0
编号 | 题目 | 状态 | 分数 | 总时间 | 内存 | 代码 / 答案文件 | 提交者 | 提交时间 |
---|---|---|---|---|---|---|---|---|
#3495 | #1028. 小秋的完美数字 | Accepted | 100 | 24 ms | 6 K | C++ / 364 B | lenijwp | 2019-06-26 16:46:53 |
#include <bits/stdc++.h>
using namespace std;
int cnt;
int main() {
int l = 1;
int r = 1000000000;
int ans = 0;
int x;
cnt = 0;
while (cnt <= 100) {
cnt++;
ans = (l + r) >> 1;
cout << ans << endl;
fflush(stdout);
cin >> x;
if (x == 0) {
break;
l = ans + 1;
} else {
if (x == 1) {
r = ans - 1;
} else {
l = ans + 1;
}
}
}
return 0;
}