QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#586691 | #9381. 502 Bad Gateway | ucup-team1769 | Compile Error | / | / | C++20 | 648b | 2024-09-24 15:02:52 | 2024-09-24 15:02:52 |
Judging History
answer
#include <bits/stdc++.h>
#define int long long
using u32 = unsigned;
using i64 = long long;
using u64 = unsigned long long;
using namespace std;
void solve() {
int n;
std::cin >> n;
for (int i = 0; i < n; i++) {
int t;
std::cin >> t;
int a = floor(std::sqrt(2 * t));
int b = ceil(std::sqrt(2 * t));
std::cout << std::min(int((a - 1) / 2 + t / a), int((b - 1) / 2 + t / b)) << "\n";
}
}
signed main() {
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
int t;
//std::cin >> t;
t = 1;
while (t--) {
solve();
}
}
詳細信息
answer.code: In function ‘void solve()’: answer.code:2:13: error: expected primary-expression before ‘long’ 2 | #define int long long | ^~~~ answer.code:18:31: note: in expansion of macro ‘int’ 18 | std::cout << std::min(int((a - 1) / 2 + t / a), int((b - 1) / 2 + t / b)) << "\n"; | ^~~ answer.code:2:13: error: expected primary-expression before ‘long’ 2 | #define int long long | ^~~~ answer.code:18:57: note: in expansion of macro ‘int’ 18 | std::cout << std::min(int((a - 1) / 2 + t / a), int((b - 1) / 2 + t / b)) << "\n"; | ^~~