Submission #1009426

#TimeUsernameProblemLanguageResultExecution timeMemory
1009426oyberMutating DNA (IOI21_dna)C++17
35 / 100
23 ms3712 KiB
#include "dna.h" #include <bits/stdc++.h> using namespace std; string a; string b; int n; vector<int> at; vector<int> ta; void init(std::string A, std::string B) { a = A; b = B; n = a.size(); at.push_back(0); ta.push_back(0); int current_at = 0; int current_ta = 0; for (int i = 0; i < n; i++) { if (a[i] == 'A' && b[i] == 'T') { current_at++; } else if (a[i] == 'T' && b[i] == 'A') { current_ta++; } at.push_back(current_at); ta.push_back(current_ta); //printf("%d %d\n", current_at, current_ta); } } int get_distance(int x, int y) { int current_at = at[y+1] - at[x]; int current_ta = ta[y+1] - ta[x]; if (current_at != current_ta) { return -1; } return current_at; }
#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...