QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#586691#9381. 502 Bad Gatewayucup-team1769Compile Error//C++20648b2024-09-24 15:02:522024-09-24 15:02:52

Judging History

你现在查看的是最新测评结果

  • [2024-09-24 15:02:52]
  • 评测
  • [2024-09-24 15:02:52]
  • 提交

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";
      |                                                         ^~~