QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#823114 | #9909. 阿尔塔尔 2 | tanxi | Compile Error | / | / | C++14 | 751b | 2024-12-20 19:28:22 | 2024-12-20 19:28:23 |
Judging History
answer
#include "altar.h"
#include<bits/stdc++.h>
using namespace std;
const int N=309;
int v[N],vis[N];
int d[N][N];
mt19937 rd(time(0));
bool get(int x,int y)
{
if(d[x][y]!=-1)
return d[x][y];
d[x][y]=sense(x,y);
d[y][x]=d[x][y]^1;
}
int altar(int n)
{
memset(d,-1,sizeof(d));
memset(v,0,sizeof(v));
memset(vis,0,sizeof(vis));
int num=n,now=n;
while(num>1)
{
int x=rd()%now+1;
int p=0;
for(int i=1;i<=n;i++)
{
if(v[i]||vis[i])
continue;
x--;
if(!x)
{
p=i;
break;
}
}
for(int i=1;i<=n;i++)
{
if(!v[i])
{
v[i]=get(i,j);
num-=v[i];
if(!vis[i]&&v[i])
now--;
}
}
vis[p]=1;
now--;
}
for(int i=1;i<=n;i++)
if(!v[i])
return i;
}
Details
answer.code: In function ‘int altar(int)’: answer.code:40:44: error: ‘j’ was not declared in this scope 40 | v[i]=get(i,j); | ^ answer.code: In function ‘bool get(int, int)’: answer.code:13:16: warning: control reaches end of non-void function [-Wreturn-type] 13 | d[y][x]=d[x][y]^1; | ~~~~~~~^~~~~~~~~~ answer.code: In function ‘int altar(int)’: answer.code:52:1: warning: control reaches end of non-void function [-Wreturn-type] 52 | } | ^