QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#849785 | #9909. 阿尔塔尔 2 | guleng2007 | Compile Error | / | / | C++20 | 403b | 2025-01-09 18:15:30 | 2025-01-09 18:15:39 |
Judging History
answer
#include <bits/stdc++.h>
#include "altar.h"
using namespace std;
void solve(vector <int> vec)
{
int x=vec[rnd()%vec.size()];
vector <int> newvec;
for(auto y:vec)
if(y!=x && sense(y,x))
newvec.push_back(y);
if(newvec.size()==0)
return x;
return solve(newvec);
}
int altar(int n)
{
vector <int> vec;
for(int i=1;i<=n;i++)
vec.push_back(i);
return solve(vec);
}
详细
answer.code: In function ‘void solve(std::vector<int>)’: answer.code:7:19: error: ‘rnd’ was not declared in this scope; did you mean ‘rand’? 7 | int x=vec[rnd()%vec.size()]; | ^~~ | rand answer.code:14:24: error: return-statement with a value, in function returning ‘void’ [-fpermissive] 14 | return x; | ^ answer.code: In function ‘int altar(int)’: answer.code:24:21: error: void value not ignored as it ought to be 24 | return solve(vec); | ~~~~~^~~~~