QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#410748#73. MineralsgelastropodCompile Error//C++14608b2024-05-14 13:51:312024-05-14 13:51:31

Judging History

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

  • [2024-05-14 13:51:31]
  • 评测
  • [2024-05-14 13:51:31]
  • 提交

answer

#include "minerals.h"
using namespace std;

void Solve(int N)
{
    vector<int> firsts, seconds;
    for (int i = 1; i <= 2 * N; i++)
    {
        if (Query(i) > firsts.size())
            firsts.push_back(i);
        else
            seconds.push_back(i);
    }
    for (int i = 1; i <= 2 * N; i++) Query(i);
    for (int i : firsts)
    {
        Query(i);
        for (int j = 0; j < N; j++)
        {
            if (Query(seconds[j]) == 1)
            {
                Answer(i, seconds[j]);
            }
            Query(seconds[j]);
        }
        Query(i);
    }
}

Details

answer.code: In function ‘void Solve(int)’:
answer.code:6:5: error: ‘vector’ was not declared in this scope
    6 |     vector<int> firsts, seconds;
      |     ^~~~~~
answer.code:2:1: note: ‘std::vector’ is defined in header ‘<vector>’; did you forget to ‘#include <vector>’?
    1 | #include "minerals.h"
  +++ |+#include <vector>
    2 | using namespace std;
answer.code:6:12: error: expected primary-expression before ‘int’
    6 |     vector<int> firsts, seconds;
      |            ^~~
answer.code:9:24: error: ‘firsts’ was not declared in this scope
    9 |         if (Query(i) > firsts.size())
      |                        ^~~~~~
answer.code:12:13: error: ‘seconds’ was not declared in this scope
   12 |             seconds.push_back(i);
      |             ^~~~~~~
answer.code:15:18: error: ‘firsts’ was not declared in this scope
   15 |     for (int i : firsts)
      |                  ^~~~~~
answer.code:20:23: error: ‘seconds’ was not declared in this scope
   20 |             if (Query(seconds[j]) == 1)
      |                       ^~~~~~~
answer.code:24:19: error: ‘seconds’ was not declared in this scope
   24 |             Query(seconds[j]);
      |                   ^~~~~~~