Submission #426534

# Submission time Handle Problem Language Result Execution time Memory
426534 2021-06-14T06:08:29 Z 반딧불(#7615) Ancient Machine (JOI21_ancient_machine) C++17
0 / 100
130 ms 10112 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++){
        int tmp = S[i] - 'X';
        Send(tmp/2);
        Send(tmp%2);
    }
}
#include "Bruno.h"
#include <bits/stdc++.h>

using namespace std;

namespace {
    int n;
    int arr[100002];
    vector<int> X, Z;
}  // namespace

void Bruno(int N, int L, vector<int> A) {
    n = N;
    for(int i=0; i<n; i++){
        arr[i] = A[i*2] * 2 + A[i*2+1];
    }
    for(int i=0; i<n; i++){
        if(arr[i] == 2) Z.push_back(i);
    }
    reverse(Z.begin(), Z.end());

    int xOpen = -1;
    for(int i=0; i<n; i++){
        if(xOpen == -1){
            if(arr[i]) Remove(i);
            else{
                xOpen = i;
            }
            continue;
        }

        if(arr[i] == 2){
            Remove(i);
            continue;
        }
        int j = i;
        while(j+1<n && arr[j+1]!=2) j++;
        for(int k=j; k>=i; k--) Remove(k);
        i=j;
    }
    Remove(xOpen);
}

Compilation message

Anna.cpp: In function 'void Anna(int, std::vector<char>)':
Anna.cpp:12:10: warning: unused variable 'need' [-Wunused-variable]
   12 |     char need = 'X';
      |          ^~~~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 488 KB Output is correct
2 Correct 2 ms 488 KB Output is correct
3 Correct 1 ms 488 KB Output is correct
4 Correct 1 ms 488 KB Output is correct
5 Correct 2 ms 484 KB Output is correct
6 Correct 1 ms 568 KB Output is correct
7 Correct 2 ms 488 KB Output is correct
8 Correct 1 ms 488 KB Output is correct
9 Correct 1 ms 576 KB Output is correct
10 Incorrect 1 ms 488 KB Wrong Answer [3]
11 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Partially correct 83 ms 10076 KB Partially correct
2 Partially correct 87 ms 10112 KB Partially correct
3 Partially correct 84 ms 9936 KB Partially correct
4 Partially correct 86 ms 9900 KB Partially correct
5 Partially correct 83 ms 9936 KB Partially correct
6 Partially correct 95 ms 9952 KB Partially correct
7 Partially correct 84 ms 10000 KB Partially correct
8 Partially correct 83 ms 9872 KB Partially correct
9 Partially correct 88 ms 9932 KB Partially correct
10 Partially correct 86 ms 9904 KB Partially correct
11 Partially correct 90 ms 9900 KB Partially correct
12 Partially correct 96 ms 10068 KB Partially correct
13 Partially correct 100 ms 9788 KB Partially correct
14 Partially correct 102 ms 10052 KB Partially correct
15 Partially correct 130 ms 9948 KB Partially correct
16 Partially correct 116 ms 9836 KB Partially correct
17 Partially correct 112 ms 9820 KB Partially correct
18 Incorrect 105 ms 9728 KB Wrong Answer [3]
19 Halted 0 ms 0 KB -