系统信息
Exited with return code 0
编号 | 题目 | 状态 | 分数 | 总时间 | 内存 | 代码 / 答案文件 | 提交者 | 提交时间 |
---|---|---|---|---|---|---|---|---|
#3492 | #1028. 小秋的完美数字 | Accepted | 100 | 23 ms | 5 K | C++ / 365 B | lenijwp | 2019-06-26 16:46:13 |
#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;
printf("%d\n", ans);
fflush(stdout);
scanf("%d", &x);
if (x == 0) {
break;
} else {
if (x == 1) {
r = ans - 1;
} else {
l = ans + 1;
}
}
}
return 0;
}