제출 #788014

#제출 시각아이디문제언어결과실행 시간메모리
788014jamkelDNA 돌연변이 (IOI21_dna)C++17
0 / 100
25 ms6220 KiB
#include <bits/stdc++.h> using namespace std; #define st first #define nd second typedef long long ll; vector<int>q(100000); vector<vector<int>>p(6,vector<int>(100000)); void init(string a, string b) { for(int i=0;i<a.length();i++) { if(i>0) { q[i]+=q[i-1]; for(int w=0;w<6;w++) { p[w][i]+=p[w][i-1]; } } if(a[i]!=b[i]) { q[i]++; if(a[i]=='A' && b[i]=='T') { p[0][i]++; } if(a[i]=='A' && b[i]=='C') { p[1][i]++; } if(a[i]=='T' && b[i]=='C') { p[2][i]++; } if(a[i]=='T' && b[i]=='A') { p[3][i]++; } if(a[i]=='C' && b[i]=='T') { p[4][i]++; } if(a[i]=='C' && b[i]=='A') { p[5][i]++; } } } } int get_distance(int x, int y) { if(x==0) { return (q[y]-min(p[0][y],p[3][y])-min(p[1][y],p[5][y])-min(p[2][y],p[4][y])); } return ((q[y]-q[x-1])-min(p[0][y]-p[0][x-1],p[3][y]-p[3][x-1])-min(p[1][y]-p[1][x-1],p[5][y]-p[5][x-1])-min(p[2][y]-p[2][x-1],p[4][y]-p[4][x-1])); }

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

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