QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#400796#6749. TargetHuangHanShengCompile Error//C++98507b2024-04-27 16:13:122024-04-27 16:13:13

Details

answer.code: In function ‘int main()’:
answer.code:7:11: error: ‘tuple’ was not declared in this scope
    7 |     queue<tuple<double, std::string>> q;
      |           ^~~~~
answer.code:7:11: note: ‘std::tuple’ is only available from C++11 onwards
answer.code:7:39: error: template argument 1 is invalid
    7 |     queue<tuple<double, std::string>> q;
      |                                       ^
answer.code:7:39: error: template argument 2 is invalid
answer.code:9:5: error: ‘q’ was not declared in this scope
    9 |     q.push({a, ""});
      |     ^
answer.code:9:12: warning: extended initializer lists only available with ‘-std=c++11’ or ‘-std=gnu++11’ [-Wc++11-extensions]
    9 |     q.push({a, ""});
      |            ^
answer.code:11:14: warning: structured bindings only available with ‘-std=c++17’ or ‘-std=gnu++17’ [-Wc++17-extensions]
   11 |         auto [x, cnt] = q.front();
      |              ^
answer.code:11:14: error: ISO C++ forbids declaration of ‘structured binding’ with no type [-fpermissive]
   11 |         auto [x, cnt] = q.front();
      |              ^~~~~~~~
answer.code:11:14: error: structured binding declaration cannot be C++98 ‘auto’
answer.code:11:14: error: structured binding declaration cannot have type ‘int’
answer.code:11:14: note: type must be cv-qualified ‘auto’ or reference to cv-qualified ‘auto’
answer.code:20:16: warning: extended initializer lists only available with ‘-std=c++11’ or ‘-std=gnu++11’ [-Wc++11-extensions]
   20 |         q.push({x * 0.5, cnt + '1'});
      |                ^
answer.code:21:16: warning: extended initializer lists only available with ‘-std=c++11’ or ‘-std=gnu++11’ [-Wc++11-extensions]
   21 |         q.push({(x - 1) * 0.5 + 1.0, cnt + '2'});
      |                ^