Submission #725013

# Submission time Handle Problem Language Result Execution time Memory
725013 2023-04-16T12:56:54 Z piOOE Ancient Machine (JOI21_ancient_machine) C++17
0 / 100
75 ms 8048 KB
#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 time Memory Grader output
1 Correct 1 ms 512 KB Output is correct
2 Correct 1 ms 520 KB Output is correct
3 Correct 0 ms 604 KB Output is correct
4 Correct 1 ms 512 KB Output is correct
5 Incorrect 1 ms 524 KB Wrong Answer [6]
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 75 ms 8048 KB Wrong Answer [6]
2 Halted 0 ms 0 KB -