Submission #808895

# Submission time Handle Problem Language Result Execution time Memory
808895 2023-08-05T12:16:25 Z MohamedAliSaidane Ancient Machine (JOI21_ancient_machine) C++17
0 / 100
34 ms 7956 KB
#include "Anna.h"
#include <bits/stdc++.h>

using namespace std;


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

using namespace std;
#define pb push_back

void Bruno(int N, int L, std::vector<int> A) 
{
  vector<int> zs;
  int cnt = 0;
  for(int i = 0; i < L; i++)
  {
    if(cnt < 2 && A[i] == 0)
    {
      Remove(i);
    }
    else if(A[i] == 1)
    {
      cnt++;
      if(cnt >= 3)
        zs.pb(i);
    }
  }
  for(auto z: zs)
  {
    for(int i = z - 1; i >= 0 && (A[i] == 0); i--)
    {
      Remove(i);
    }
    Remove(z);
  }
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 520 KB Wrong Answer [5]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 34 ms 7956 KB Wrong Answer [5]
2 Halted 0 ms 0 KB -