QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#657442#5304. Money GameHuangHanShengCompile Error//C++20901b2024-10-19 14:46:262024-10-19 14:46:26

Details

answer.code: In function ‘int main()’:
answer.code:14:9: error: ‘vector’ was not declared in this scope
   14 |         vector<double>a(n+1);
      |         ^~~~~~
answer.code:6:1: note: ‘std::vector’ is defined in header ‘<vector>’; did you forget to ‘#include <vector>’?
    5 | #include<iomanip>
  +++ |+#include <vector>
    6 | using namespace std;
answer.code:14:16: error: expected primary-expression before ‘double’
   14 |         vector<double>a(n+1);
      |                ^~~~~~
answer.code:20:17: error: ‘a’ was not declared in this scope
   20 |                 a[i] = k;
      |                 ^
answer.code:22:16: error: expected primary-expression before ‘double’
   22 |         vector<double>b(n+1);
      |                ^~~~~~
answer.code:23:33: error: ‘b’ was not declared in this scope
   23 |         for(int i = 1;i<=n;i++) b[i] = a[i];
      |                                 ^
answer.code:23:40: error: ‘a’ was not declared in this scope
   23 |         for(int i = 1;i<=n;i++) b[i] = a[i];
      |                                        ^
answer.code:26:31: error: ‘b’ was not declared in this scope
   26 |                 double temp = b[i]/2.0;
      |                               ^
answer.code:35:25: error: ‘a’ was not declared in this scope
   35 |                 if(fabs(a[i]-b[i])>=1e-6)
      |                         ^
answer.code:35:30: error: ‘b’ was not declared in this scope
   35 |                 if(fabs(a[i]-b[i])>=1e-6)
      |                              ^
answer.code:35:20: error: ‘fabs’ was not declared in this scope; did you mean ‘labs’?
   35 |                 if(fabs(a[i]-b[i])>=1e-6)
      |                    ^~~~
      |                    labs
answer.code:44:29: error: ‘a’ was not declared in this scope
   44 |                     cout << a[i] << ' ';
      |                             ^
answer.code:49:52: error: ‘a’ was not declared in this scope
   49 |                 for(int i =1;i<=n;i++) sum = sum + a[i];
      |                                                    ^
answer.code:51:17: error: ‘a’ was not declared in this scope
   51 |                 a[1] = ans;
      |                 ^