Submission #924205

# Submission time Handle Problem Language Result Execution time Memory
924205 2024-02-08T16:18:30 Z Camillus Brperm (RMI20_brperm) C++17
Compilation error
0 ms 0 KB
#define debug(...) 42
#include "bits/stdc++.h"
using namespace std;

#ifndef LOCAL
#include "brperm.h"
#else
void init(int n, const char s[]);
int query(int i, int k);
#endif

int n;
char s[500500];

void init(int N, const char S[]) {
    int n = N;
    for (int i = 0; i < n; i++) {
        s[i] = S[i];
    }
}

int swapped(int i, int k) {
    int a = 1;
    int b = 1 << (k - 1);

    if (bool(i & a) == bool(i & b)) {
        return i;
    } else {
        i ^= a;
        i ^= b;
        return i;
    }
}

int query(int i, int k) {
    assert(i + (1 << k) <= n);
    // string t(s.begin() + i, s.begin() + i + (1 << k));
    // for (int j = 0; j < (1 << k); j++) {
    //     if (t[j] != t[swapped(j, k)]) {
    //         return false;
    //     }
    // }
    return true;
}

#ifdef LOCAL
char __s[(int)5e5 + 10] = {};

int main() {
    cin >> __s;
    init(strlen(__s), __s);

    int __x, __y;
    while (cin >> __x >> __y)
        cout << query(__x, __y) << '\n';

    return 0;
}
#endif

Compilation message

/usr/bin/ld: /tmp/ccDuTHam.o:(.bss+0x0): multiple definition of `s'; /tmp/ccjjw7wp.o:(.bss+0x0): first defined here
collect2: error: ld returned 1 exit status