Submission #999082

#TimeUsernameProblemLanguageResultExecution timeMemory
999082KasymKMutating DNA (IOI21_dna)C++17
43 / 100
1555 ms2460 KiB
#include <bits/stdc++.h> using namespace std; const int N = 1e5+5; // int a_s[N], c_s[N], t_s[N], a_s2[N], c_s2[N], t_s2[N], diff[N]; string s, s2; void init(string a, string b){ s = a, s2 = b; } int get_distance(int x, int y){ int sm = 0, sm2 = 0, sm3 = 0; for(int i = x; i <= y; ++i){ if(s[i] == 'A') sm++; if(s2[i] == 'A') sm--; if(s[i] == 'C') sm2++; if(s2[i] == 'C') sm2--; if(s[i] == 'T') sm3++; if(s2[i] == 'T') sm3--; } if(sm or sm2 or sm3) return -1; int answer = 1; for(int i = x; i <= y; ++i) answer += (s[i] != s2[i]); answer /= 2; return answer; }
#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...