Submission #1142537

#TimeUsernameProblemLanguageResultExecution timeMemory
1142537sam12345678910112DNA 돌연변이 (IOI21_dna)C++20
Compilation error
0 ms0 KiB
 #include<bits/stdc++.h>
using namespace std;
# define ll long long
string A ,B;
int f[100003];
int fra[100003];
int frt[100003];
int fra2[100003];
int frt2[100003];
void init(string a, string b){
    string A=a;
    string B=b;
    for(int so=0;so<A.size();so++){
        f[so]=0;
        if(so!=0){f[so]+=f[so];}
        if(A[so]!=B[so]){ f[so]+=1;}
        if(A[so]=='T'){frt[so]=0;frt[so]+=1+frt[max(so-1,0)];}
          if(A[so]=='A'){fra[so]=0;fra[so]+=1+fra[max(so-1,0)];}
           if(B[so]=='T'){frt2[so]=0;frt2[so]+=1+frt2[max(so-1,0)];}
          if(B[so]=='A'){fra2[so]=0;fra2[so]+=1+fra2[max(so-1,0)];}
    }
}
int get_distance(int x, int y){
    if(frt[y]-frt[x]==frt2[y]-frt2[x]&&fra[y]-fra[x]==fra2[y]-fra2[x]){return f[y]-f[x];}
    else{ return -1;}
}
int main() {
  ll n,q;
  cin>>n>>q;
  string a,b;
  cin>>a>>b;
  init(a,b);
  int x,y;
  while(q--){
      cin>>x>>y;
      cout<<get_distance(x,y);
  }
}

Compilation message (stderr)

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