QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#203699#5505. Great ChaseYueyCompile Error//C++201.0kb2023-10-06 19:28:232023-10-06 19:28:23

Judging History

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

  • [2023-10-06 19:28:23]
  • 评测
  • [2023-10-06 19:28:23]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
const int N = 2e6 + 10;
#define int long long
double x[N], w[N];
int n;
bool check(double mid)
{
    double r1 = -1e12, r2 = 1e12;
    for (int i = 1; i <= n; i++)
    {
        if (x[i] < 0)
        {
            r1 = max(r1, x[i] + mid * w[i]);
        }
        else
            r2 = min(r2, x[i] - mid * w[i]);
    }

    return r1 > r2; // 相遇
}
void solve()
{
    cin >> n;
    double v;
    cin >> v;
    for (int i = 1; i <= n; i++)
    {
        cin >> x[i] >> w[i];
    }
    double l = 0, r = 1e12;
    fpr(int i = 1; i <= 600; ++i)
    {
        double mid = (l + r) / 2;
        if (check(mid))
            r = mid;
        else
            l = mid;
    }
    double ans = l * v;
    printf("%.12lf\n", ans);
}
signed main()
{
    int t = 1;
    cin >> t;
    while (t--)
        solve();

    // system("pause");
}

詳細信息

answer.code:9:1: error: extended character   is not valid in an identifier
    9 |     double r1 = -1e12, r2 = 1e12;
      | ^
answer.code:9:3: error: extended character   is not valid in an identifier
    9 |     double r1 = -1e12, r2 = 1e12;
      |   ^
answer.code:10:1: error: extended character   is not valid in an identifier
   10 |     for (int i = 1; i <= n; i++)
      | ^
answer.code:10:3: error: extended character   is not valid in an identifier
   10 |     for (int i = 1; i <= n; i++)
      |   ^
answer.code:11:1: error: extended character   is not valid in an identifier
   11 |     {
      | ^
answer.code:11:3: error: extended character   is not valid in an identifier
   11 |     {
      |   ^
answer.code:12:1: error: extended character   is not valid in an identifier
   12 |         if (x[i] < 0)
      | ^
answer.code:12:3: error: extended character   is not valid in an identifier
   12 |         if (x[i] < 0)
      |   ^
answer.code:12:5: error: extended character   is not valid in an identifier
   12 |         if (x[i] < 0)
      |     ^
answer.code:12:7: error: extended character   is not valid in an identifier
   12 |         if (x[i] < 0)
      |       ^
answer.code:13:1: error: extended character   is not valid in an identifier
   13 |         {
      | ^
answer.code:13:3: error: extended character   is not valid in an identifier
   13 |         {
      |   ^
answer.code:13:5: error: extended character   is not valid in an identifier
   13 |         {
      |     ^
answer.code:13:7: error: extended character   is not valid in an identifier
   13 |         {
      |       ^
answer.code:14:1: error: extended character   is not valid in an identifier
   14 |             r1 = max(r1, x[i] + mid * w[i]);
      | ^
answer.code:14:3: error: extended character   is not valid in an identifier
   14 |             r1 = max(r1, x[i] + mid * w[i]);
      |   ^
answer.code:14:5: error: extended character   is not valid in an identifier
   14 |             r1 = max(r1, x[i] + mid * w[i]);
      |     ^
answer.code:14:7: error: extended character   is not valid in an identifier
   14 |             r1 = max(r1, x[i] + mid * w[i]);
      |       ^
answer.code:14:9: error: extended character   is not valid in an identifier
   14 |             r1 = max(r1, x[i] + mid * w[i]);
      |         ^
answer.code:14:11: error: extended character   is not valid in an identifier
   14 |             r1 = max(r1, x[i] + mid * w[i]);
      |           ^
answer.code:15:1: error: extended character   is not valid in an identifier
   15 |         }
      | ^
answer.code:15:3: error: extended character   is not valid in an identifier
   15 |         }
      |   ^
answer.code:15:5: error: extended character   is not valid in an identifier
   15 |         }
      |     ^
answer.code:15:7: error: extended character   is not valid in an identifier
   15 |         }
      |       ^
answer.code:16:1: error: extended character   is not valid in an identifier
   16 |         else
      | ^
answer.code:16:3: error: extended character   is not valid in an identifier
   16 |         else
      |   ^
answer.code:16:5: error: extended character   is not valid in an identifier
   16 |         else
      |     ^
answer.code:16:7: error: extended character   is not valid in an identifier
   16 |         else
      |       ^
answer.code:17:1: error: extended character   is not valid in an identifier
   17 |             r2 = min(r2, x[i] - mid * w[i]);
      | ^
answer.code:17:3: error: extended character   is not valid in an identifier
   17 |             r2 = min(r2, x[i] - mid * w[i]);
      |   ^
answer.code:17:5: error: extended character   is not valid in an identifier
   17 |             r2 = min(r2, x[i] - mid * w[i]);
      |     ^
answer.code:17:7: error: extended character   is not valid in an identifier
   17 |             r2 = min(r2, x[i] - mid * w[i]);
      |       ^
answer.code:17:9: error: extended character   is not valid in an identifier
   17 |             r2 = min(r2, x[i] - mid * w[i]);
      |         ^
answer.code:17:11: error: extended character   is not valid in an identifier
   17 |             r2 = min(r2, x[i] - mid * w[i]);
      |           ^
answer.code:18:1: error: extended character   is not valid in an identifier
   18 |     }
      | ^
answer.code:18:3: error: extended character   is not valid in an identifier
   18 |     }
      |   ^
answer.code:20:1: error: extended character   is not valid in an identifier
   20 |     return r1 > r2; // 相遇
      | ^
answer.code:20:3: error: extended character   is not valid in an identifier
   20 |     return r1 > r2; // 相遇
      |   ^
answer.code:24:1: error: extended character   is not valid in an identifier
   24 |     cin >> n;
      | ^
answer.code:24:3: error: extended character   is not valid in an identifier
   24 |     cin >> n;
      |   ^
answer.code:25:1: error: extended character   is not valid in an identifier
   25 |     double v;
      | ^
answer.code:25...