QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#100479 | #5556. Diabolic Doofenshmirtz | PetroTarnavskyi# | WA | 2ms | 3248kb | C++17 | 675b | 2023-04-26 15:26:21 | 2023-04-26 15:26:22 |
Judging History
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;
}
詳細信息
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]