Submission #1288852

#TimeUsernameProblemLanguageResultExecution timeMemory
1288852harryleeeMutating DNA (IOI21_dna)C++20
Compilation error
0 ms0 KiB
#include<bits/stdc++.h>
#include "dna.h"

using namespace std;
const int maxn = 1e5;
int dif[maxn + 1], AinT[maxn + 1], aa[maxn + 1], at[maxn + 1], ba[maxn + 1], bt[maxn + 1];

int check(int l, int r){
    l++; r++;
    if ((aa[r] - aa[l - 1]) != (ba[r] - ba[l - 1])) return -1;
    if ((bt[r] - bt[l - 1]) != (at[r] - at[l - 1])) return -1;
    int res = dif[r] - dif[l - 1];
    res -= (AinT[r] - AinT[l - 1]);
    return res;
}

void init(string a, string b){
    a = " " + a;
    b = " " + b;
    for (int i = 0; i < a.size(); ++i){
        dif[i] = dif[i - 1] + (a[i] != 'C' && a[i] != b[i]);
        AinT[i] = AinT[i - 1] + (a[i] == 'A' && b[i] == 'T');
        aa[i] = aa[i - 1] + (a[i] == 'A');
        at[i] = at[i - 1] + (a[i] == 'T');
        ba[i] = ba[i - 1] + (b[i] == 'A');
        bt[i] = bt[i - 1] + (b[i] == 'T');
    }
    return;
}

Compilation message (stderr)

/usr/bin/ld: /tmp/ccg8kHoZ.o: in function `main':
grader.cpp:(.text.startup+0x382): undefined reference to `get_distance(int, int)'
collect2: error: ld returned 1 exit status