QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#772655#6542. Optimal Quadratic FunctionutilforeverCompile Error//C++232.9kb2024-11-22 21:04:462024-11-22 21:04:47

詳細信息

answer.code:22:7: error: ‘GOLDEN_RATIO’ does not name a type
   22 | const GOLDEN_RATIO = (1.0 + sqrt(5.0)) / 2.0;
      |       ^~~~~~~~~~~~
answer.code: In function ‘f128 calculate_b(const std::vector<long double>&, const std::vector<long double>&, f128)’:
answer.code:34:22: error: ‘GOLDEN_RATIO’ was not declared in this scope
   34 |         f128 mid1 = (GOLDEN_RATIO * left + right) / (1.0 + GOLDEN_RATIO);
      |                      ^~~~~~~~~~~~
answer.code: In function ‘f128 calculate_a(const std::vector<long double>&, const std::vector<long double>&)’:
answer.code:60:22: error: ‘GOLDEN_RATIO’ was not declared in this scope
   60 |         f128 mid1 = (GOLDEN_RATIO * left + right) / (1.0 + GOLDEN_RATIO);
      |                      ^~~~~~~~~~~~