Submission #716307

#TimeUsernameProblemLanguageResultExecution timeMemory
716307kidlinMutating DNA (IOI21_dna)C++17
Compilation error
0 ms0 KiB
#include<bits/stdc++.h>
using namespace std;

string s,t;
void init(string a,string b){
    s=a,t=b;
}
int get_distance(int x, int y)
{
        int T0=0,C0=0,A0=0,T1=0,A1=0,C1=0;
        int res=0;
        for(int j=x; j<=y; j++)
        {
            if(s[j]=='T') T0++;
            if(s[j]=='C') C0++;
            if(s[j]=='A') A0++;
            if(t[j]=='T') T1++;
            if(t[j]=='C') C1++;
            if(t[j]=='A') A1++;
            if(s[j]!=t[j]) res++;
        }
        if(T0!=T1 || C0!=C1 || A1!=A0)return -1;
        return (res+1)/2;
}
signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int t=1;
    //cin >> t;
    while(t--)
    {
        solve();
    }
}

Compilation message (stderr)

dna.cpp: In function 'int main()':
dna.cpp:34:9: error: 'solve' was not declared in this scope
   34 |         solve();
      |         ^~~~~