Submission #994555

#TimeUsernameProblemLanguageResultExecution timeMemory
994555ducksaysquackMutating DNA (IOI21_dna)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #define int long long using namespace std; char c[3] = {'A','C','T'}; vector<vector<int>> v(3), w(3); vector<int> p; void init(string a, string b) { int n = a.size(); for(int i=0;i<3;i++) v[i].resize(n+1), w[i].resize(n+1); p.resize(n+1); for(int i=0;i<n;i++) for(int j=0;j<3;j++) v[j][i+1] = (a[i]==c[j])+v[j][i], w[j][i+1] = (b[i]==c[j])+w[j][i]; for(int i=0;i<n;i++) p[i+1] = p[i]+(a[i]!=b[i]); } int get_distance(int x, int y) { bool yes = true; for(int i=0;i<3;i++) if(v[i][y+1]-v[i][x] != w[i][y+1]-w[i][x]) yes = false; if(yes) return (p[y+1]-p[x]+1)/2; else return -1; }

Compilation message (stderr)

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