一直在JUDGING 第一次写通信 求助
查看原帖
一直在JUDGING 第一次写通信 求助
883658
tony808楼主2024/10/3 01:45
#include <bits/stdc++.h>
using namespace std;
long long a = 400000000;
long long b = 399999999;
int main()
{
	long long times;
	cin >> times;
	for ( long long i = 1; i <= times; i++) {

		cout << '?' << ' ' << a << endl;
		long long read1;
		cin >> read1;
		if (read1 == -1) return 0;
		cout << '?' << ' ' << b << endl;
		long long read2;
		cin >> read2;
		if (read2 == -1) return 0;
		if (read1 == read2) {
			cout << '!' << ' ' << read1<<endl;
			continue;
		}
		if (read1 > read2) read2 += b;
		long long delta = read2 - read1;
		cout << '!' << ' ' << ((a*delta)+read1)<<endl;
	}
	return 0;
}
2024/10/3 01:45
加载中...