Submission #583661

#TimeUsernameProblemLanguageResultExecution timeMemory
583661CauchicoMutating DNA (IOI21_dna)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; int n; vector<array<int,6>> arr; //ac,at,ca,ct,ta,tc void init(string a, string b) { n = a.size(); arr.resize(n+1); for (int i=0;i<n;i++) { arr[i+1] = arr[i]; if (a[i] == 'A') { if (b[i] == 'C') { arr[i+1][0]++; } if (b[i] == 'T') { arr[i+1][1]++; } } if (a[i] == 'C') { if (b[i] == 'A') { arr[i+1][2]++; } if (b[i] == 'T') { arr[i+1][3]++; } } if (a[i] == 'T') { if (b[i] == 'A') { arr[i+1][4]++; } if (b[i] == 'C') { arr[i+1][5]++; } } } } int get_distance(int x, int y) { y++; int aa = arr[y][0] + arr[y][1] - arr[x][0] - arr[x][1]; int ab = arr[y][2] + arr[y][4] - arr[x][2] - arr[x][4]; int ca = arr[y][2] + arr[y][3] - arr[x][2] - arr[x][3]; int cb = arr[y][0] + arr[y][5] - arr[x][0] - arr[x][5]; int ta = arr[y][4] + arr[y][5] - arr[x][4] - arr[x][5]; int tb = arr[y][1] + arr[y][3] - arr[x][1] - arr[x][3]; if (aa-ab != 0 or ca-cb != 0 or ta-tb != 0) { return -1; } array<int,6> diff; for (int i=0;i<6;i++) { diff[i] = arr[y][i] - arr[x][i]; } int ans = min(diff[0],diff[2])+min(diff[1],diff[4])+min(diff[3],diff[5]); int uni = abs(diff[0]-diff[2])+abs(diff[1]-diff[4])+abs(diff[3]-diff[5]); return ans + max(uni-1,0); } int main() { return 0; }

Compilation message (stderr)

/usr/bin/ld: /tmp/ccOPucTt.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/cczsEdwr.o:dna.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status