Submission #1309002

#TimeUsernameProblemLanguageResultExecution timeMemory
1309002duongquanghai08Ancient Machine (JOI21_ancient_machine)C++20
0 / 100
30 ms6256 KiB
#include "Anna.h"
#include <bits/stdc++.h>
using namespace std;
void Anna(int n, vector<char> S) {
    bool check = false;
    for(auto x : S) {
        if(x == 'X' && !check) {
            check = true;
            Send(1);
            continue;
        }
        if(!check) Send(0);
        else {
            if(x == 'X' || x == 'Y') Send(0);
            else Send(1);
        }
  }
}
#include "Bruno.h"
#include <bits/stdc++.h>
using namespace std;
void Bruno(int n, int L, vector<int> A) {
    bool check = false;
    int pos = -1;
    stack<int> st;
    for(int i = 0; i < n; i++) {
        if(A[i] == 1 && !check) {
            check = true;
            pos = i;
            continue;
        }
        if(!check) Remove(i);
        if(A[i] == 1) {
            while(!st.empty()) Remove(st.top()), st.pop();
            Remove(i);
        }
        else st.push(i);
    }
    if(pos != -1) Remove(pos);
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...