系统信息
Exited with return code 0
编号 | 题目 | 状态 | 分数 | 总时间 | 内存 | 代码 / 答案文件 | 提交者 | 提交时间 |
---|---|---|---|---|---|---|---|---|
#47411 | #1028. 小秋的完美数字 | Accepted | 100 | 8 ms | 400 K | C++ / 356 B | 计算机82赵启 | 2021-04-03 0:35:17 |
#include <stdio.h>
const int MAX = 1e9;
unsigned long int a, b = MAX, c = 0;
int main() {
int i, ans;
for (i = 0; i < 100; i++) {
a = (b + c) >> 1;
printf("%lu\n", a);
fflush(stdout);
scanf("%d", &ans);
if (ans == -1) {
c = a + 1;
} else if (ans == 1) {
b = a;
} else if (ans == 0)
break;
}
return 0;
}