QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#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();
}
}
Details
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"; | ^~~