제출 #934355

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

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

dna.cpp: In function 'void init(std::string, std::string)':
dna.cpp:8:19: 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 = 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...