QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#326104#3098. Ancient MachineNATURAL60 0ms4060kbC++141.8kb2024-02-12 11:51:592024-02-12 11:52:00

Judging History

你现在查看的是最新测评结果

  • [2024-02-12 11:52:00]
  • 评测
  • 测评结果:0
  • 用时:0ms
  • 内存:4060kb
  • [2024-02-12 11:51:59]
  • 提交

Anna

#include "Anna.h"
#include<bits/stdc++.h>
using namespace std;
namespace ANNA
{
    const int MAXN = 1e5, W = 63, B = 44;
    int n,p;
    vector<char>s;
    int b[100010];
    unsigned long long a[64],sxc;
    inline void solve()
    {
        p=0;
        while(p<n&&s[p]!='X')++p;
        b[p]=1;
        for(int i=p+1;i<n;++i) 
        {
            while(i<n&&s[i]!='Z')++i;
            while(i+1<n&&s[i+1]=='Z')++i;
            if(p>=n||i>=n)break;
            b[i+1]=1;
        }
        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;i<=n;i+=63) 
        {
            sxc=0;
            for(int j=i;j<=i+63-1;++j)if(b[j])sxc+=a[i+63-1-j];
            for(int j=0;j<B;++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;
    vector<int>sbs;
    int b[100010];
    unsigned long long a[64],sxc;
    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];
            l=i/44*63,r=l+62;
            for(int j=l;j<=r;++j)if(sxc>=a[r-j])b[j]=1,sxc-=a[r-j];
        }
        p=0;
        while(p<n&&!b[p])Remove(p++);
        if(p==n)return ;
        for(int i=p+1,lp=p;i<n;++i) 
        {
            while(i<n&&!b[i+1])++i;
            for(int j=i-1;j>=lp+1;--j)Remove(j);
            if(i<n)Remove(lp=i++);
        }
        Remove(p);
    }
}
void Bruno(int n,int l,vector<int>SXC) 
{
    BRUNO::n=n,BRUNO::sbs=SXC;
    BRUNO::solve();
    return ;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 100
Accepted
time: 0ms
memory: 4060kb

input:

18
Y X Y Z X Z X X Z Z Y Y Z Y Y Z X X

output:

44
11001010110010000011111110001011010000000001

input:

44
11001010110010000011111110001011010000000001

output:

0 44 3

result:

ok n = 18, D = 44, L = 3

Test #2:

score: 0
Wrong Answer
time: 0ms
memory: 3768kb

input:

18
X Z X Y Y Y X Z X Y Z Z Z Z Y Z Z Y

output:

44
11010011101110011101111100001100011100011011

input:

44
11010011101110011101111100001100011100011011

output:

5

result:

wrong answer Wrong Answer [5]

Subtask #2:

score: 0
Programme Bruno Runtime Error

Test #12:

score: 0
Programme Bruno Runtime Error

input:

100000
X Z X Z Z X Y Z Y X Y X Z Z Z Y X Z Y X Y Y X Y Y Y Z Y Z Z Y X X Y X X Y Y X X X Z Y Y Y Z Z Z Z Y X Y Y Z Z Z X Y Z X X X X Y X Y X X Z X Z Z Z X Y X X X Z X Z X X X Y Y Y Y Z X X Y Z Y Y X Z X Z Z Z Z Z Y Z Y X Y Y Y Y X Z Z Y Z Z Y Z Z Z X Z Z X X Z Z Z Z X X Z Y Y Z Y Y Z Z Y Y Z Y Z Y Z...

output:

69872
101100101010101100100101100010011101011001111111010011011100001110000000101011111001000000000011001000010010111100011001101010111000101001001000000110110001110010101111001000101010011111000100111000101001010001000010100010100101010011111000101111001001010010010110111110000000001100010111110111...

input:


output:


result: