Submission #1071453

# Submission time Handle Problem Language Result Execution time Memory
1071453 2024-08-23T07:30:16 Z 12345678 Ancient Machine (JOI21_ancient_machine) C++17
70 / 100
63 ms 8892 KB
#include "Anna.h"
#include <bits/stdc++.h>

using namespace std;

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

using namespace std;

const int nx=1e5+5;
int lst=0, rem[nx];

void Bruno(int N, int L, std::vector<int> A) {
    int st=-1, lst=-1;
    for (int i=0; i<N; i++)
    {
        if (A[i])
        {
            if (st==-1) 
            {
                lst=st=i;
            }
            else
            {
                for (int j=i-1; j>lst; j--) rem[j]=1, Remove(j);
                lst=i;
                rem[i]=1, Remove(i);
            }
        }
    }
    for (int i=0; i<N; i++) if (!rem[i]) Remove(i);
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 788 KB Output is correct
2 Correct 1 ms 796 KB Output is correct
3 Correct 0 ms 784 KB Output is correct
4 Correct 0 ms 780 KB Output is correct
5 Correct 1 ms 796 KB Output is correct
6 Correct 1 ms 780 KB Output is correct
7 Correct 0 ms 796 KB Output is correct
8 Correct 1 ms 784 KB Output is correct
9 Correct 0 ms 776 KB Output is correct
10 Correct 0 ms 796 KB Output is correct
11 Correct 1 ms 784 KB Output is correct
# Verdict Execution time Memory Grader output
1 Partially correct 45 ms 8264 KB Partially correct
2 Partially correct 51 ms 8764 KB Partially correct
3 Partially correct 43 ms 8712 KB Partially correct
4 Partially correct 43 ms 8684 KB Partially correct
5 Partially correct 34 ms 8604 KB Partially correct
6 Partially correct 40 ms 8620 KB Partially correct
7 Partially correct 40 ms 8640 KB Partially correct
8 Partially correct 35 ms 8616 KB Partially correct
9 Partially correct 42 ms 8892 KB Partially correct
10 Partially correct 53 ms 8552 KB Partially correct
11 Partially correct 36 ms 8636 KB Partially correct
12 Partially correct 43 ms 8656 KB Partially correct
13 Partially correct 56 ms 8644 KB Partially correct
14 Partially correct 53 ms 8496 KB Partially correct
15 Partially correct 49 ms 8628 KB Partially correct
16 Partially correct 42 ms 8712 KB Partially correct
17 Partially correct 40 ms 8444 KB Partially correct
18 Partially correct 45 ms 8356 KB Partially correct
19 Partially correct 41 ms 8464 KB Partially correct
20 Partially correct 34 ms 8708 KB Partially correct
21 Partially correct 38 ms 8672 KB Partially correct
22 Partially correct 61 ms 8620 KB Partially correct
23 Partially correct 42 ms 8680 KB Partially correct
24 Partially correct 34 ms 8668 KB Partially correct
25 Partially correct 44 ms 8432 KB Partially correct
26 Partially correct 45 ms 8364 KB Partially correct
27 Partially correct 41 ms 8292 KB Partially correct
28 Partially correct 49 ms 8380 KB Partially correct
29 Partially correct 49 ms 8204 KB Partially correct
30 Partially correct 53 ms 8204 KB Partially correct
31 Partially correct 63 ms 8380 KB Partially correct
32 Partially correct 52 ms 8784 KB Partially correct
33 Partially correct 48 ms 8764 KB Partially correct