제출 #1141920

#제출 시각아이디문제언어결과실행 시간메모리
1141920redacodeDNA 돌연변이 (IOI21_dna)C++20
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h> using namespace std; string a, b; void init(std::string a, std::string b) { } int get_distance(int x, int y) { string ax=""; string bx=""; int freq1[3]={0,0,0}; int freq2[3]={0,0,0}; for(int i=x;i<=y;i++){ ax+=a[i]; if(a[i]=='A')freq1[0]++; if(a[i]=='B')freq1[1]++; if(a[i]=='C')freq1[2]++; bx+=b[i]; if(b[i]=='A')freq2[0]++; if(b[i]=='B')freq2[1]++; if(b[i]=='C')freq2[2]++; } if(freq1[0]!=freq2[0] or freq1[1]!=freq2[1] or freq1[2]!=freq2[2]){ return -1; }else if(y-x==2){ //cout << ax << " " << bx; if(ax==bx){ return 0; }else if((ax[0]==bx[1] and ax[1]==bx[0]) or (ax[2]==bx[1] and ax[1]==bx[2])){ return 1; }else{ return 2; } }else{ if(ax==bx){ return 0; }else{ return 1; } } } int main() { int n,q; cin>>n>>q; //string a,b; cin>>a>>b; init(a,b); while(q--){ int x,y; cin>>x>>y; cout<<get_distance(x,y)<<endl; } }

컴파일 시 표준 에러 (stderr) 메시지

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