2024 Jiangsu Collegiate Programming Contest C. Radio Direction Finding 题解 交互 二分

Radio Direction Finding

题目描述

This is an interactive problem.

Radio direction finding, also known as radio orienteering or radio fox hunting, is a sport that combines radio technology with outdoor navigation. Participants use specialized receivers to locate hidden radio transmitters, testing their sense of direction and radio operation skills.

A university offers a PE course in radio direction finding. During the final exam, the teacher takes the students to a local tourist attraction. The map of the attraction can be considered as a cycle of n n n points ( n n n is an odd number), numbered clockwise as 1 , 2 , … , n 1,2,\ldots,n 1,2,,n. The teacher has previously buried two transmitters at two different points and given you a radio receiver.

This receiver is special; each time it receives a signal, you need to manually press a button on the receiver, and then the receiver will tell you the sum of the shortest distances from these two transmitters to your current location (distance is defined as the number of edges traversed). The passing criterion for the final exam is to find the positions of these two transmitters using the receiver no more than 40 40 40 times.

Now, please write an interactive program to successfully pass the final exam.

交互

First, read a positive integer T T T ( 1 ≤ T ≤ 1 0 3 1 \le T \le 10^3 1T103) from the standard input, indicating the number of test cases.

For each test case, first read a positive integer n n n ( 3 ≤ n ≤ 1 0 9 3 \le n \le 10^9 3n10

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值