QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#100479#5556. Diabolic DoofenshmirtzPetroTarnavskyi#WA 2ms3248kbC++17675b2023-04-26 15:26:212023-04-26 15:26:22

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-04-26 15:26:22]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:3248kb
  • [2023-04-26 15:26:21]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;

#define SZ(a) (int)a.size()
#define ALL(a) a.begin(), a.end()
#define FOR(i, a, b) for (int i = (a); i<(b); ++i)
#define RFOR(i, b, a) for (int i = (b)-1; i>=(a); --i)
#define MP make_pair
#define PB push_back
#define F first
#define S second

typedef long long LL;
typedef pair<int, int> PII;
typedef vector<int> VI;

int main()
{
	//ios::sync_with_stdio(false);
	cin.tie(0);
	LL l = 0, r = 1e12 + 47;
	while (r - l > 1) {
		LL m = (l + r) / 2;
		cout << "? " << m << endl;
		LL x;
		cin >> x;
		if (x == m) {
			l = m;
		}
		else {
			r = m;
		}
	}
	cout << "! " << r << endl;
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 2ms
memory: 3248kb

input:

13

output:

? 500000000023
? 250000000011

result:

wrong answer Integer 250000000011 violates the range [500000000024, 1000000000000000001]