Submission #684401

# Submission time Handle Problem Language Result Execution time Memory
684401 2023-01-21T06:04:19 Z mjhmjh1104 Ancient Machine (JOI21_ancient_machine) C++17
Compilation error
0 ms 0 KB
#include "Anna.h"
#include <vector>
using namespace std;

void Bruno(int n, int l, vector<int> b) {
    int lt = n, rt = 0;
    vector<int> a;
    for (int i = 0; i < (int)b.size() - 17; i++) {
        if (b[i]) a.push_back(1), a.push_back(0);
        else a.push_back(0);
    }
    for (int i = (int)b.size() - 17; i < (int)b.size(); i++) a.push_back(b[i]);
    for (int t = 0; t <= 16; t++) if (a[n + t]) rt |= 1 << t;
    for (int i = n - 1; i >= 0; i--) if (a[i] || !i) {
        for (int j = i + 1; j < lt; j++) if (a[j]) Remove(j);
        for (int j = i + 1; j < lt; j++) if (!a[j] && j != rt) Remove(j);
        if (i != rt) Remove(i);
        lt = i;
    }
    Remove(rt);
}
#include "Bruno.h"
#include <vector>
using namespace std;

void Bruno(int n, int l, vector<int> b) {
    int lt = n, rt = 0;
    vector<int> a;
    for (int i = 0; i < (int)b.size() - 17; i++) {
        if (b[i]) a.push_back(1), a.push_back(0);
        else a.push_back(0);
    }
    for (int i = (int)b.size() - 17; i < (int)b.size(); i++) a.push_back(b[i]);
    for (int t = 0; t <= 16; t++) if (a[n + t]) rt |= 1 << t;
    for (int i = n - 1; i >= 0; i--) if (a[i] || !i) {
        for (int j = i + 1; j < lt; j++) if (a[j]) Remove(j);
        for (int j = i + 1; j < lt; j++) if (!a[j] && j != rt) Remove(j);
        if (i != rt) Remove(i);
        lt = i;
    }
    Remove(rt);
}

Compilation message

Anna.cpp: In function 'void Bruno(int, int, std::vector<int>)':
Anna.cpp:15:52: error: 'Remove' was not declared in this scope
   15 |         for (int j = i + 1; j < lt; j++) if (a[j]) Remove(j);
      |                                                    ^~~~~~
Anna.cpp:16:64: error: 'Remove' was not declared in this scope
   16 |         for (int j = i + 1; j < lt; j++) if (!a[j] && j != rt) Remove(j);
      |                                                                ^~~~~~
Anna.cpp:17:22: error: 'Remove' was not declared in this scope
   17 |         if (i != rt) Remove(i);
      |                      ^~~~~~
Anna.cpp:20:5: error: 'Remove' was not declared in this scope
   20 |     Remove(rt);
      |     ^~~~~~