Submission #1028761

# Submission time Handle Problem Language Result Execution time Memory
1028761 2024-07-20T08:18:06 Z AdamGS Ancient Machine (JOI21_ancient_machine) C++17
69 / 100
46 ms 8740 KB
#include "Anna.h"
#include<bits/stdc++.h>
using namespace std;
#define rep(a, b) for(int a = 0; a < (b); ++a)
#define st first
#define nd second
#define pb push_back
#define all(a) a.begin(), a.end()
void Anna(int n, vector<char>T) {
  vector<int>P(n);
  bool xd=false;
  rep(i, n) if(T[i]=='X') {
    xd=true;
    P[i]=1;
    for(int j=i+1; j<n; ++j) {
      if(T[j]=='Z') P[j]=1;
    }
    for(int j=n-1; j; --j) if(P[j-1] && P[j]) P[j-1]=0;
    if(P[i]==0) Send(1); else Send(0);
    break;
  }
  if(xd==false) Send(0);
  rep(i, n) Send(P[i]);
}
#include "Bruno.h"
#include<bits/stdc++.h>
using namespace std;
#define rep(a, b) for(int a = 0; a < (b); ++a)
#define st first
#define nd second
#define pb push_back
#define all(a) a.begin(), a.end()
void Bruno(int n, int m, vector<int>T) {
  int x=-1;
  rep(i, n) {
    if(T[i+1]) {
      x=i;
      break;
    }
  }
  if(T[0]) --x;
  if(x==-1) {
    rep(i, n) Remove(i);
    return;
  }
  rep(i, x) Remove(i);
  int lst=x;
  for(int i=x+1; i<n; ++i) if(T[i+1]) {
    for(int j=i-1; j>lst; --j) Remove(j);
    Remove(i);
    lst=i;
  }
  Remove(x);
  for(int i=lst+1; i<n; ++i) Remove(i);
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 780 KB Output is correct
2 Correct 1 ms 788 KB Output is correct
3 Correct 0 ms 796 KB Output is correct
4 Correct 1 ms 784 KB Output is correct
5 Correct 0 ms 784 KB Output is correct
6 Correct 0 ms 796 KB Output is correct
7 Correct 1 ms 796 KB Output is correct
8 Correct 0 ms 796 KB Output is correct
9 Correct 0 ms 796 KB Output is correct
10 Correct 0 ms 796 KB Output is correct
11 Correct 0 ms 784 KB Output is correct
# Verdict Execution time Memory Grader output
1 Partially correct 30 ms 8460 KB Partially correct
2 Partially correct 31 ms 8272 KB Partially correct
3 Partially correct 30 ms 8604 KB Partially correct
4 Partially correct 32 ms 8684 KB Partially correct
5 Partially correct 34 ms 8700 KB Partially correct
6 Partially correct 33 ms 8680 KB Partially correct
7 Partially correct 35 ms 8628 KB Partially correct
8 Partially correct 33 ms 8720 KB Partially correct
9 Partially correct 37 ms 8704 KB Partially correct
10 Partially correct 34 ms 8720 KB Partially correct
11 Partially correct 33 ms 8616 KB Partially correct
12 Partially correct 33 ms 8720 KB Partially correct
13 Partially correct 44 ms 8620 KB Partially correct
14 Partially correct 37 ms 8712 KB Partially correct
15 Partially correct 34 ms 8644 KB Partially correct
16 Partially correct 34 ms 8692 KB Partially correct
17 Partially correct 39 ms 8680 KB Partially correct
18 Partially correct 38 ms 8644 KB Partially correct
19 Partially correct 38 ms 8648 KB Partially correct
20 Partially correct 32 ms 8688 KB Partially correct
21 Partially correct 31 ms 8644 KB Partially correct
22 Partially correct 37 ms 8632 KB Partially correct
23 Partially correct 31 ms 8712 KB Partially correct
24 Partially correct 32 ms 8696 KB Partially correct
25 Partially correct 41 ms 8648 KB Partially correct
26 Partially correct 42 ms 8628 KB Partially correct
27 Partially correct 46 ms 8636 KB Partially correct
28 Partially correct 43 ms 8740 KB Partially correct
29 Partially correct 44 ms 8640 KB Partially correct
30 Partially correct 42 ms 8408 KB Partially correct
31 Partially correct 41 ms 8720 KB Partially correct
32 Partially correct 34 ms 8708 KB Partially correct
33 Partially correct 37 ms 8564 KB Partially correct