QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#100477#5556. Diabolic DoofenshmirtzPetroTarnavskyi#WA 2ms3364kbC++17675b2023-04-26 15:25:002023-04-26 15:25:01

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:25:01]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:3364kb
  • [2023-04-26 15:25:00]
  • 提交

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 << "\n";
	return 0;
}

詳細信息

Test #1:

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

input:

13

output:

? 500000000023
? 250000000011

result:

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