제출 #867474

#제출 시각아이디문제언어결과실행 시간메모리
867474thegamercoder19DNA 돌연변이 (IOI21_dna)C++17
0 / 100
18 ms7628 KiB
#include "dna.h" #include<bits/stdc++.h> using namespace std; vector<vector<int>> prefix; void init(std::string a, std::string b) { prefix.resize(3, vector<int>(a.size()+1)); for(int i=0; i<a.size(); i++) { for(int j=0; j<3; j++) { prefix[j][i+1] = prefix[j][i]; } prefix[a[i]-'A'][i+1]++; prefix[b[i]-'A'][i+1]--; } } int get_distance(int x, int y) { int dist = 0; for(int i=0; i<3; i++) { dist += abs(prefix[i][y+1] - prefix[i][x]); } return dist/2; }

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

dna.cpp: In function 'void init(std::string, std::string)':
dna.cpp:9:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    9 |    for(int i=0; i<a.size(); i++) {
      |                 ~^~~~~~~~~
#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...