1584 : 暗水位
- 时间限制Time Limit
- 1 秒Sec
- 内存限制Memory Limit
- 256 兆MB
- 提交次数Submitted
- 140 次Times
- 通过次数Solved
- 66 次Times
各语言实际时限 Time Limits by Language
| C / C++ | 1 s |
|---|---|
| Java / Python3 / Kotlin |
3 s
1s + 2s
|
全局时限上限:30 s(补偿后超出截断) Global time cap: 30 s (after allowances)
各语言实际内存 Memory Limits by Language
| C / C++ | 256 MB |
|---|---|
| Java / Kotlin |
768 MB
256 + 512 MB · 含 JVM
256 + 512 MB · JVM
|
| Python3 |
768 MB
256 + 512 MB
|
全局内存上限:2048 MB(补偿后超出截断) Global memory cap: 2048 MB (after allowances)
交互评测 Interactive
程序通过标准输入输出与评测进程实时问答。每次写出后须立即
flush,否则评测可能一直等待。
The program talks to the judge in real time through standard input and output. Flush after every write, or the judge may wait indefinitely.
| 读Read | 标准输入,内容由评测按协议给出。Standard input; the judge writes according to the protocol. |
|---|---|
| 写Write | 标准输出。每次输出后须 flush。C:fflush(stdout);C++:cout.flush();Java / Kotlin:System.out.flush();Python:print(..., flush=True)。Standard output. Flush after each write: fflush(stdout) / cout.flush() / System.out.flush() (Java/Kotlin) / print(..., flush=True). |
| 时间与内存Time and memory | 记选手程序的 CPU 时间和内存峰值。与之对话的评测进程不计入。题目上的限制只约束选手程序。The record is the solution’s CPU time and peak memory. The judge process it talks to is not included. The limits apply only to the solution. |
题目描述Description
泊位有一条隐藏的整数水位 T。你看不到 T,只能试探。
这是一道交互题。通过询问确定 T,规则见下文。
输入格式Input
一次询问写成
? x
其中 x 是整数,且 0\le x\le 10^9。交互器回答一行:若 x\ge T 则为 1,否则为 0。
至多询问 32 次。然后输出
! T
并结束程序。每次输出后刷新缓冲区。
隐藏的水位满足 0\le T\le 10^9。
交互协议
程序启动后不要先读入数据。直接询问,最后输出答案。
输出格式Output
按协议写出最终答案,并在每次输出后刷新缓冲区。
样例Sample
提示Hint
样例 1 的隐藏水位是 6。样例 2 的隐藏水位是 0。询问方式不唯一。
出题Author
Grok4.7, DeepSeekV4Flash, CSGrandeur
来源Source
CCPC2026网络热身-第二场
题目到此结束End of problem