#include"lokahia.h"
#include<cstring>
#include<vector>
#include<ctime>
#include<algorithm>
#define eb emplace_back
#define fi first
#define se second
#define all(x) (x).begin(),(x).end()
using namespace std;
typedef long long ll;
typedef pair<int,int>pi;
typedef pair<ll,ll>pl;
const ll inf=1e18;
int pa[205],sz[205];
int par(int x)
{
if(pa[x]==-1)
return x;
return pa[x]=par(pa[x]);
}
int C[205];
vector<int>v;
int FindBase(int N)
{
if(N==1)
return 0;
int i;
for(i=0;i<N;i++)
v.eb(i);
memset(pa,-1,sizeof pa);
fill(sz,sz+205,1);
for(i=0;i<600&&v.size()>1;i++)
{
int n=rand()%v.size();
int j=n;
while(j==n)
j=rand()%v.size();
int t=CollectRelics(n,j);
if(t!=-1)
{
t=par(t);
if(n!=t)
{
vector<int>::iterator it=v.begin();
while(it!=v.end())
{
if(*it==n)
break;
it++;
}
v.erase(it);
pa[n]=t;
sz[t]+=sz[n];
}
n=j;
if(n!=t)
{
vector<int>::iterator it=v.begin();
while(it!=v.end())
{
if(*it==n)
break;
it++;
}
v.erase(it);
pa[n]=t;
sz[t]+=sz[n];
}
}
}
for(i=0;i<N;i++)
if(pa[i]==-1&&sz[i]>=N/2)
break;
if(i>=N)
return-1;
return sz[i];
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
6 ms |
768 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
2 |
Runtime error |
7 ms |
768 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
3 |
Runtime error |
6 ms |
640 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
4 |
Runtime error |
6 ms |
768 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
5 |
Runtime error |
6 ms |
640 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
6 |
Runtime error |
6 ms |
640 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
7 |
Runtime error |
7 ms |
640 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
8 |
Partially correct |
6 ms |
600 KB |
Partially correct : C = 600 |
9 |
Runtime error |
6 ms |
768 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
10 |
Runtime error |
7 ms |
768 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
11 |
Runtime error |
7 ms |
640 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
12 |
Runtime error |
7 ms |
768 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
13 |
Runtime error |
6 ms |
768 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
14 |
Runtime error |
6 ms |
692 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
15 |
Runtime error |
6 ms |
768 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
16 |
Correct |
5 ms |
512 KB |
Correct : C = 0 |
17 |
Partially correct |
6 ms |
640 KB |
Partially correct : C = 600 |
18 |
Runtime error |
6 ms |
640 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
19 |
Runtime error |
6 ms |
768 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
20 |
Runtime error |
6 ms |
640 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
21 |
Runtime error |
7 ms |
768 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
22 |
Runtime error |
6 ms |
640 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
23 |
Runtime error |
6 ms |
640 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
24 |
Runtime error |
6 ms |
512 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |
25 |
Partially correct |
6 ms |
512 KB |
Partially correct : C = 600 |
26 |
Partially correct |
6 ms |
640 KB |
Partially correct : C = 600 |
27 |
Runtime error |
5 ms |
640 KB |
Execution killed with signal 11 (could be triggered by violating memory limits) |