Submission #725013

#TimeUsernameProblemLanguageResultExecution timeMemory
725013piOOEAncient Machine (JOI21_ancient_machine)C++17
0 / 100
75 ms8048 KiB
#include "Anna.h"
#include <bits/stdc++.h>

using namespace std;

void Anna(int n, std::vector<char> s) {
    int type = 0;

    for (int i = 0; i < n; ++i) {
        int use = 0;

        if (s[i] == 'X') {
            if (type == 0) {
                type |= 1;
                use = 1;
            }
        } else if (s[i] == 'Y') {
            if ((type & 1) && !(type & 2)) {
                type |= 2;
                use = 1;
            }
        } else if (s[i] == 'Z') {
            if ((type & 1) && (type & 2)) {
                type ^= 2;
                use = 1;
            }
        }

        Send(use);
    }
}
#include "Bruno.h"
#include <bits/stdc++.h>

using namespace std;

void Bruno(int N, int L, std::vector<int> A) {
    for (int i = 0; i < N; ++i) {
        if (A[i] == 0) {
            Remove(i);
        }
    }
    int fi = find(A.begin(), A.end(), 1) - A.begin();
    if (fi != N) {
        for (int i = fi + 1; i < N; ++i) {
            if (A[i] == 1) {
                Remove(i);
            }
        }
        Remove(fi);
    }
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...