Submission #911094

# Submission time Handle Problem Language Result Execution time Memory
911094 2024-01-18T12:47:24 Z alexander707070 Ancient Machine (JOI21_ancient_machine) C++17
0 / 100
44 ms 8440 KB
#include "Anna.h"
#include <vector>

namespace {

bool x;

}

void Anna(int N, std::vector<char> S) {
    for(int i=0;i<N;i++){
        if(S[i]=='X' and !x){
            x=true; Send(1);
        }else if(S[i]=='Z' and x){
            Send(1);
        }else{
            Send(0);
        }
    }
}
#include "Bruno.h"
#include <vector>

namespace {

int fr,last;

}  // namespace

void Bruno(int N, int L, std::vector<int> A) {
    for(int i=0;i<L;i++){
        if(A[i]==1 and fr==-1){
            fr=i;
        }
    }
    for(int i=0;i<fr;i++)Remove(i);

    last=fr;
    for(int i=fr+1;i<L;i++){
        if(A[i]==1){
            for(int f=i-1;f>last;f--)Remove(f);
            Remove(i); last=i;
        }
    }

    for(int i=L-1;i>=0 and A[i]==0;i--)Remove(i);
    if(fr!=-1)Remove(fr);
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 784 KB Wrong Answer [6]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Partially correct 44 ms 8440 KB Partially correct
2 Incorrect 43 ms 8392 KB Wrong Answer [6]
3 Halted 0 ms 0 KB -