제출 #966768

#제출 시각아이디문제언어결과실행 시간메모리
966768SuPythonyDNA 돌연변이 (IOI21_dna)C++17
0 / 100
23 ms2832 KiB
#include "dna.h" #include <bits/stdc++.h> using namespace std; vector<int> pf(1e5+1,0); void init(string a, string b) { for (int i=1; i<=a.size(); i++) { if (a[i]!=b[i]) { pf[i]=pf[i-1]+1; } else { pf[i]=pf[i-1]; } } } int get_distance(int x, int y) { int c=pf[y]-pf[x-1]; return c/2+c%2; }

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

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