Submission #1151155

#TimeUsernameProblemLanguageResultExecution timeMemory
1151155ShadowSharkAncient Machine (JOI21_ancient_machine)C++20
Compilation error
0 ms0 KiB
#include "Anna.h"
#include <bits/stdc++.h>
using namespace std;

void send(int x) {};

void Anna(int N, std::vector<char> S) {
    int firstX = -1;
    for (int i = 0; i < N; i++) {
        if (S[i] == 'X') {
            firstX = i;
            break;
        }
    }

    for (int i = 1; i <= firstX; i++)
        send(1);
    send(0);

    int pre = firstX;
    for (int j = firstX + 1; j < N; j++) {
        if (S[j] == 'Z') {
            for (int k = 2; k <= j - pre; k++)
                send(1);
            send(0);
            pre = j;
        }
    }
}
#include "Bruno.h"
#include <bits/stdc++.h>

void Remove(int x) {};

void Bruno(int N, int L, std::vector<int> A) {
    bool mark[200005];
    memset(mark, false, sizeof mark);

    int firstX = 1;
    for (int i = 0; i < L; i++)
        if (A[i] == 1) firstX++;
            else break;

    int pre = firstX, cnt = 0;
    for (int j = firstX; j < L; j++) {
        if (A[j] == 1) cnt++;
            else {
                int nxt = pre + cnt + 1;
                for (int i = nxt - 1; i >= pre && !mark[i]; i--) {
                    Remove(i - 1);
                    mark[i] = true;
                }
                pre = nxt;
            }
    }

    for (int i = 1; i <= N; i++)
        if (!mark[i]) {
            mark[i] = true;
            Remove(i - 1);
        }
}

Compilation message (stderr)

# 2번째 컴파일 단계

/usr/bin/ld: /tmp/ccadolUB.o: in function `Remove(int)':
grader_bruno.cpp:(.text+0x30): multiple definition of `Remove(int)'; /tmp/ccY9kCd5.o:Bruno.cpp:(.text+0x0): first defined here
collect2: error: ld returned 1 exit status