제출 #1129460

#제출 시각아이디문제언어결과실행 시간메모리
1129460ozner77DNA 돌연변이 (IOI21_dna)C++20
0 / 100
35 ms2884 KiB
#define ll long long #include <bits/stdc++.h> using namespace std; int n; string a1,b1; void init(string a,string b){ a1=a;b1=b; n=a.size(); } int get_distance(int x, int y){ x--;y--; map<int,int> M; map<int,int> M1; int res; for(int i=x;i<=y;i++){ M[a1[i]]++; M1[b1[i]]++; if(a1[i]!=b1[i]){ res++; } } bool com=false; for(auto x:M){ if(x.second==M1[x.first]){ if(res%2==0){ return res/2; }else{ return (res/2)+1; } }else{ return -1; } } }

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

dna.cpp: In function 'int get_distance(int, int)':
dna.cpp:34:1: warning: control reaches end of non-void function [-Wreturn-type]
   34 | }
      | ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...