Submission #1156507

#TimeUsernameProblemLanguageResultExecution timeMemory
1156507steveonalexcmp (balkan11_cmp)C++20
Compilation error
0 ms0 KiB

/*

 ________  ___  ________  ________          ________   ___  ________  ________  ________     
    |\   ____\|\  \|\   ____\|\   __  \        |\   ___  \|\  \|\   ____\|\   ____\|\   __  \    
    \ \  \___|\ \  \ \  \___|\ \  \|\  \       \ \  \\ \  \ \  \ \  \___|\ \  \___|\ \  \|\  \   
     \ \  \  __\ \  \ \  \  __\ \   __  \       \ \  \\ \  \ \  \ \  \  __\ \  \  __\ \   __  \  
      \ \  \|\  \ \  \ \  \|\  \ \  \ \  \       \ \  \\ \  \ \  \ \  \|\  \ \  \|\  \ \  \ \  \ 
       \ \_______\ \__\ \_______\ \__\ \__\       \ \__\\ \__\ \__\ \_______\ \_______\ \__\ \__\
        \|_______|\|__|\|_______|\|__|\|__|        \|__| \|__|\|__|\|_______|\|_______|\|__|\|__|
                                                                                                 
                                                                                             
                                                                                             
     ________  ________  ________  ________  ___  ___  ________ _________  ___  ________  ________      
|\   __  \|\   __  \|\   __  \|\   ___ \|\  \|\  \|\   ____\\___   ___\\  \|\   __  \|\   ___  \    
\ \  \|\  \ \  \|\  \ \  \|\  \ \  \_|\ \ \  \\\  \ \  \___\|___ \  \_\ \  \ \  \|\  \ \  \\ \  \   
 \ \   ____\ \   _  _\ \  \\\  \ \  \ \\ \ \  \\\  \ \  \       \ \  \ \ \  \ \  \\\  \ \  \\ \  \  
  \ \  \___|\ \  \\  \\ \  \\\  \ \  \_\\ \ \  \\\  \ \  \____   \ \  \ \ \  \ \  \\\  \ \  \\ \  \ 
   \ \__\    \ \__\\ _\\ \_______\ \_______\ \_______\ \_______\  \ \__\ \ \__\ \_______\ \__\\ \__\
    \|__|     \|__|\|__|\|_______|\|_______|\|_______|\|_______|   \|__|  \|__|\|_______|\|__| \|__|
                                                                                                    
                                                                                                    
    Written by: giga nigga                                                                               

*/

// #include "largest.h"
#include <bits/stdc++.h>
 
using namespace std;
 
typedef long long ll;
typedef unsigned long long ull;
 
#define MASK(i) (1ULL << (i))
#define GETBIT(mask, i) (((mask) >> (i)) & 1)
#define ALL(v) (v).begin(), (v).end()
 
ll max(ll a, ll b){return (a > b) ? a : b;}
ll min(ll a, ll b){return (a < b) ? a : b;}
ll gcd(ll a, ll b){return __gcd(a, b);}
ll lcm(ll a, ll b){return a / gcd(a, b) * b;}
 
ll LASTBIT(ll mask){return (mask) & (-mask);}
int pop_cnt(ull mask){return __builtin_popcountll(mask);}
int ctz(ull mask){return __builtin_ctzll(mask);}
int logOf(ull mask){return 63 - __builtin_clzll(mask);}
 
// mt19937_64 rng(chrono::high_resolution_clock::now().time_since_epoch().count());
mt19937_64 rng(1);
ll rngesus(ll l, ll r){return l + (ull) rng() % (r - l + 1);}
double rngesus_d(double l, double r){
    double wow = (double) ((ull) rng()) / ((ull)(0-1));
    return wow * (r - l) + l;
}
 
template <class T1, class T2>
    bool maximize(T1 &a, T2 b){
        if (a < b) {a = b; return true;}
        return false;
    }
 
template <class T1, class T2>
    bool minimize(T1 &a, T2 b){
        if (a > b) {a = b; return true;}
        return false;
    }
 
template <class T>
    void printArr(T container, string separator = " ", string finish = "\n", ostream &out = cout){
        for(auto item: container) out << item << separator;
        out << finish;
    }
 
template <class T>
    void remove_dup(vector<T> &a){
        sort(ALL(a));
        a.resize(unique(ALL(a)) - a.begin());
    }

#include "cmp.h"

int cur_tape;
bitset<10240> tape[4096];
int cnt1 = 0, cnt2 = 0;

void bit_set(int i){
    cnt1++;
    tape[cur_tape][i-1] = 1;
}
int bit_get(int i){
    cnt2++;
    return tape[cur_tape][i-1];
}

void remember(int n) {
    for(int i = 0; i < 4; ++i){
        int cur = GETBIT(n, 11-i*3) * 4 + GETBIT(n, 10 - i*3) * 2 + GETBIT(n, 9-i*3);
        bit_set(i * 8 + cur + 1);
    }
}

int compare(int n) {
    for(int i = 0; i < 4; ++i){
        int cur = GETBIT(n, 11-i*3) * 4 + GETBIT(n, 10 - i*3) * 2 + GETBIT(n, 9-i*3);
        if (bit_get(i * 8 + cur + 1) == 0){
            if (cur <= 3){
                for(int j = 0; j < cur; ++j){
                    if (bit_get(i * 8 + j + 1)) return 1;
                }
                return -1;
            }
            else{
                for(int j = cur+1; j < 8; ++j){
                    if (bit_get(i * 8 + j + 1)) return -1;
                }
                return 1;
            }
        }
    }    
    return 0;
}

Compilation message (stderr)

/usr/bin/ld: /tmp/cc9jeIjB.o: in function `bit_set(int)':
grader.c:(.text+0x0): multiple definition of `bit_set(int)'; /tmp/ccKNj7PD.o:cmp.cpp:(.text+0xf0): first defined here
/usr/bin/ld: /tmp/cc9jeIjB.o: in function `bit_get(int)':
grader.c:(.text+0xd0): multiple definition of `bit_get(int)'; /tmp/ccKNj7PD.o:cmp.cpp:(.text+0x130): first defined here
collect2: error: ld returned 1 exit status