제출 #774727

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
7747272023-07-06 02:16:19SanguineChameleonDNA 돌연변이 (IOI21_dna)C++17
100 / 100
32 ms8584 KiB
#include "dna.h"
#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 20;
int diff[maxn][3];
int cnt[maxn][3][3];
void init(string a, string b) {
int n = a.size();
for (int i = 1; i <= n; i++) {
for (int x = 0; x < 3; x++) {
diff[i][x] = diff[i - 1][x];
for (int y = 0; y < 3; y++) {
cnt[i][x][y] = cnt[i - 1][x][y];
}
}
int x = a[i - 1] == 'A' ? 0 : a[i - 1] == 'T' ? 1 : 2;
int y = b[i - 1] == 'A' ? 0 : b[i - 1] == 'T' ? 1 : 2;
cnt[i][x][y]++;
diff[i][x]++;
diff[i][y]--;
}
}
int get_distance(int lt, int rt) {
lt++;
rt++;
for (int x = 0; x < 3; x++) {
if (diff[rt][x] != diff[lt - 1][x]) {
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#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...