QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#889656 | #10071. Hora | ucup-team004 | Compile Error | / | / | C++23 | 879b | 2025-02-08 17:08:21 | 2025-02-08 17:08:21 |
Judging History
This is the latest submission verdict.
- [2025-02-08 17:08:21]
- Judged
- Verdict: Compile Error
- Time: 0ms
- Memory: 0kb
- [2025-02-08 17:08:21]
- Submitted
answer
#include "hora.h"
#include <bits/stdc++.h>
using i64 = long long;
using u64 = unsigned long long;
using u32 = unsigned;
using u128 = unsigned __int128;
int query(int L, int R) {
int res = ask(L, R);
int len = (R - L + N) % N + 1;
return res * 2 - len;
}
int solve(int N, int K) {
if (2 * K == N) {
int lo = 0, hi = K;
int a = query(0, K - 1);
int b = -a;
if (std::abs(a) <= 1) {
return 0;
}
while (true) {
int m = (lo + hi) / 2;
int c = query(m, (m + K - 1) % N);
if (std::abs(c) <= 1) {
return m;
}
if ((a > 0) != (c > 0)) {
b = c;
hi = m;
} else {
a = c;
lo = m;
}
}
}
return 0;
}
詳細信息
answer.code: In function ‘int query(int, int)’: answer.code:11:24: error: ‘N’ was not declared in this scope 11 | int len = (R - L + N) % N + 1; | ^