Submission #426471

# Submission time Handle Problem Language Result Execution time Memory
426471 2021-06-14T04:44:09 Z 반딧불(#7615) Ancient Machine (JOI21_ancient_machine) C++17
0 / 100
85 ms 8068 KB
#include "Anna.h"
#include <bits/stdc++.h>

using namespace std;

namespace {
    int n;
}

void Anna(int N, vector<char> S) {
    n = N;
    char need = 'X';
    for(int i=0; i<n; i++){
        if(S[i] == need) Send(1), need = (need == 'Z') ? 'X' : need+1;
        else Send(0);
    }
}
#include "Bruno.h"
#include <bits/stdc++.h>

using namespace std;

namespace {
    int n;
}  // namespace

void Bruno(int N, int L, vector<int> A) {
    n = N;
    for(int i=0; i<n; i++) if(!A[i]) Remove(i);

    int cnt = 0;
    for(int i=0; i<n; i++){
        if(!A[i]) continue;
        if(A[i]) cnt++;
        if(cnt%3==2) Remove(i);
    }

    cnt=0;
    for(int i=0; i<n; i++){
        if(!A[i]) continue;
        if(A[i]) cnt++;
        if(cnt%3!=2) Remove(i);
    }
}
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 488 KB Wrong Answer [6]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 85 ms 8068 KB Wrong Answer [6]
2 Halted 0 ms 0 KB -