Submission #547916

# Submission time Handle Problem Language Result Execution time Memory
547916 2022-04-12T03:03:32 Z tht2005 Ancient Machine (JOI21_ancient_machine) C++17
0 / 100
57 ms 7780 KB
#include "Anna.h"
#include <vector>

void Anna(int N, std::vector<char> S) {
    for(int i = 0; i < N; ++i)
        Send((int)(S[i] == 'Z'));
}
#include "Bruno.h"
#include <algorithm>
#include <vector>
#include <iostream>
#include <cassert>

void Bruno(int N, int L, std::vector<int> A) {
    assert(N == L);
    std::vector<int> stk;
    for(int i = 0; i < N; ++i) {
        if(A[i]) {
            while(!stk.empty()) {
                Remove(stk.back());
                stk.pop_back();
            }
            Remove(i);
        }
        else {
            stk.push_back(i);
        }
    }
    while(!stk.empty()) {
        Remove(stk.back());
        stk.pop_back();
    }
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 512 KB Wrong Answer [6]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 57 ms 7780 KB Wrong Answer [6]
2 Halted 0 ms 0 KB -