QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#326149 | #3098. Ancient Machine | NATURAL6 | Compile Error | / | / | C++14 | 2.5kb | 2024-02-12 13:23:06 | 2024-02-12 13:23:06 |
Judging History
Anna
#include "Anna.h"
#include<bits/stdc++.h>
using namespace std;
namespace ANNA
{
int n,p;
vector<char>s;
int b[100110];
unsigned long long a[64],sxc;
inline unsigned long long get_rk(int l,int r)
{
if(l>r)return 0;
if(l==r)return b[r];
if(b[r])return a[r-l]+get_rk(l,r-2);
return get_rk(l,r-1);
}
inline void solve()
{
for(int i=1,op=0,j;i<=n;++i)
{
if(op)
{
if(s[i-1]!='Z'){b[++p]=0;continue;}
for(j=i;j<=n&&s[j-1]=='Z';++j);
for(int k=i;k<j-1;++k)b[++p]=0;
b[++p]=1,i=j-1;
}
else
{
if(s[i-1]=='X')op=1,b[++p]=1,b[++p]=0;
else b[++p]=0;
}
}
a[0]=1,a[1]=2;
for(int i=2;i<=63;++i)a[i]=a[i-1]+a[i-2];
for(int i=1;i<=p;i+=63)
{
sxc=get_rk(i,min(p,i+62));
for(int j=0;j<44;++j)Send((sxc>>j)&1);
}
return ;
}
}
void Anna(int n,vector<char>s)
{
ANNA::n=n,ANNA::s=s;
ANNA::solve();
return ;
}
Bruno
#include "Bruno.h"
#include<bits/stdc++.h>
using namespace std;
namespace BRUNO
{
int n,p,xp=-1,lp=-1;
vector<int>sbs;
int b[100110],vis[100110];
unsigned long long a[64],sxc;
inline void get_rl(unsigned long long s,int h)
{
if(!h)return ;
if(h==1)b[++p]=s;
else
{
if(s<a[h-1])get_rl(s,h-1),b[++p]=0;
else get_rl(s-a[h-1],h-2),b[++p]=0,b[++p]=1;
}
return ;
}
inline void chk(int x)
{
if(vis[x])return ;
vis[x]=1;
Remove(x-1);
return ;
}
inline void solve()
{
a[0]=1,a[1]=2;
for(int i=2;i<=63;++i)a[i]=a[i-1]+a[i-2];
for(int i=0,l,r;i<(int)sbs.size();i+=44)
{
sxc=0;
for(int j=i+43;j>=i;--j)sxc=sxc<<1|sbs[j];
get_rl(sxc,63);
}
for(int i=1,op;i<=p;++i)
{
op=0;
if(!b[i])continue;
if(~lp)
{
for(int j=i-1;j>=max(xp+2,lp+1);--j)chk(j-1);
chk(i-1);
}
else op=1,xp=i;
lp=i,i+=op;
}
for(int i=1;i<=n;++i)Erase( i );
return ;
}
}
void Bruno(int n,int l,vector<int>SXC)
{
BRUNO::n=n,BRUNO::sbs=SXC;
BRUNO::solve();
return ;
}
Details
Bruno.code: In function ‘void BRUNO::solve()’: Bruno.code:50:30: error: ‘Erase’ was not declared in this scope 50 | for(int i=1;i<=n;++i)Erase( i ); | ^~~~~