QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#410748 | #73. Minerals | gelastropod | Compile Error | / | / | C++14 | 608b | 2024-05-14 13:51:31 | 2024-05-14 13:51:31 |
Judging History
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);
}
}
详细
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]); | ^~~~~~~