Submission #1151140

#TimeUsernameProblemLanguageResultExecution timeMemory
1151140thangdz2k7Ancient Machine (JOI21_ancient_machine)C++20
0 / 100
31 ms6080 KiB
#include "Anna.h"
#include <bits/stdc++.h>

using namespace std;

void Anna(int N, vector <char> S){
    bool ocX = false;

    for (int i = 0; i < N; ++ i){
        if (S[i] == 'X' && !ocX){
            ocX = true;
            Send(1);
        }
        else if (S[i] == 'Z' && ocX) Send(1);
        else Send(0);
    }
}
#include "Bruno.h"
#include <bits/stdc++.h>

using namespace std;

void Bruno(int N, int L, vector <int> A){
    bool ocX = false;
    vector <bool> used(N, 0);
    for (int i = 0; i < N; ++ i){
        if (A[i]){
            if (!ocX) ocX = true;
            else {
                for (int j = i - 1; j >= 0 && !A[j]; j --) Remove(j), used[i] = 1;
                Remove(i); used[i] = 1;
            }
        }
    }

    for (int i = 0; i < N; ++ i) if (!used[i]) Remove(i);
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...