Submission #426536

# Submission time Handle Problem Language Result Execution time Memory
426536 2021-06-14T06:08:41 Z 송준혁(#7530) Ancient Machine (JOI21_ancient_machine) C++17
70 / 100
104 ms 8100 KB
#include "Anna.h"
#include <vector>

namespace {

}

void Anna(int N, std::vector<char> S) {
    int i;
    int lz=-1;
    for (i=0; i<N; i++){
        if (S[i] == 'X'){Send(1); break;}
        Send(0);
    }
    int j=i+1;
    for (i++; i<N; i++){
        if (S[i] == 'Z') lz = i;
        if (S[i] == 'Y'){
            if (lz >= 0){
                while (j<lz) Send(0), j++;
                Send(1), j++;
                while (j<=i) Send(0), j++;
                lz = -1;
            }
        }
    }
    if (lz >= 0){
        while (j<lz) Send(0), j++;
        Send(1);
    }
}
#include "Bruno.h"
#include <vector>

namespace {

}

void Bruno(int N, int L, std::vector<int> A) {
    int s=N-1, x;
    for (int i=0; i<L; i++) if (A[i]) {s=i; break;}
    x = s;
    for (int i=s+1; i<L; i++){
        if (!A[i]) continue;
        for (int j=i-1; j>x; j--) Remove(j);
        Remove(i);
        x = i;
    }
    for (int i=0; i<=s; i++) Remove(i);
    for (int i=x+1; i<N; i++) Remove(i);
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 484 KB Output is correct
2 Correct 0 ms 484 KB Output is correct
3 Correct 2 ms 480 KB Output is correct
4 Correct 2 ms 496 KB Output is correct
5 Correct 0 ms 492 KB Output is correct
6 Correct 2 ms 492 KB Output is correct
7 Correct 1 ms 492 KB Output is correct
8 Correct 1 ms 484 KB Output is correct
9 Correct 2 ms 484 KB Output is correct
10 Correct 2 ms 484 KB Output is correct
11 Correct 2 ms 488 KB Output is correct
# Verdict Execution time Memory Grader output
1 Partially correct 74 ms 7564 KB Partially correct
2 Partially correct 65 ms 7740 KB Partially correct
3 Partially correct 79 ms 7676 KB Partially correct
4 Partially correct 67 ms 7568 KB Partially correct
5 Partially correct 68 ms 7660 KB Partially correct
6 Partially correct 71 ms 7648 KB Partially correct
7 Partially correct 67 ms 7628 KB Partially correct
8 Partially correct 68 ms 7692 KB Partially correct
9 Partially correct 68 ms 7680 KB Partially correct
10 Partially correct 74 ms 7668 KB Partially correct
11 Partially correct 65 ms 7628 KB Partially correct
12 Partially correct 68 ms 7648 KB Partially correct
13 Partially correct 72 ms 7660 KB Partially correct
14 Partially correct 77 ms 7604 KB Partially correct
15 Partially correct 80 ms 7576 KB Partially correct
16 Partially correct 84 ms 7624 KB Partially correct
17 Correct 58 ms 6396 KB Output is correct
18 Partially correct 74 ms 7580 KB Partially correct
19 Partially correct 86 ms 7988 KB Partially correct
20 Partially correct 74 ms 8076 KB Partially correct
21 Partially correct 68 ms 7992 KB Partially correct
22 Partially correct 104 ms 7948 KB Partially correct
23 Partially correct 66 ms 8100 KB Partially correct
24 Partially correct 65 ms 7984 KB Partially correct
25 Partially correct 74 ms 8008 KB Partially correct
26 Correct 53 ms 6644 KB Output is correct
27 Partially correct 86 ms 8000 KB Partially correct
28 Correct 55 ms 6736 KB Output is correct
29 Partially correct 79 ms 7980 KB Partially correct
30 Partially correct 78 ms 8036 KB Partially correct
31 Partially correct 82 ms 8000 KB Partially correct
32 Partially correct 67 ms 8092 KB Partially correct
33 Partially correct 64 ms 8056 KB Partially correct