제출 #1062421

#제출 시각아이디문제언어결과실행 시간메모리
1062421TheQuantiXDNA 돌연변이 (IOI21_dna)C++17
0 / 100
96 ms37716 KiB
#include <bits/stdc++.h> using namespace std; using ll = long long; ll n, m, q, k, x, y, a, b, c; ll same[100001]; map<char, int> mpa[100001]; map<char, int> mpb[100001]; void init(string a, string b) { for (int i = 0; i < a.size(); i++) { if (a[i] == b[i]) { same[i + 1]++; } same[i + 1] += same[i]; mpa[i + 1] = mpa[i]; mpb[i + 1] = mpb[i]; mpa[i + 1][a[i]]++; mpb[i + 1][b[i]]++; } } int get_distance(int x, int y) { for (auto i : {'A', 'T', 'C'}) { // cout << i << ' ' << mpa[y + 1][i] - mpa[x][i] << ' ' << mpb[y + 1][i] - mpb[x][i] << '\n'; if (mpa[y + 1][i] - mpa[x][i] != mpb[y + 1][i] - mpb[x][i]) { return -1; } } return (y - x) - (same[y + 1] - same[x]); }

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

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