Submission #446778

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
4467782021-07-23 09:01:49binsjlMutating DNA (IOI21_dna)C++17
100 / 100
40 ms4912 KiB
#include "dna.h"
#include <string>
#include <cstdlib>
using namespace std;
int A[2][100005], C[2][100005], AC[100005], same[100005];
void init(string a, string b) {
int n = a.length();
for (int i = 0; i < n; i++) {
A[0][i + 1] = A[0][i];
A[1][i + 1] = A[1][i];
C[0][i + 1] = C[0][i];
C[1][i + 1] = C[1][i];
AC[i + 1] = AC[i];
same[i + 1] = same[i];
if (a[i] == 'A')
A[0][i + 1]++;
if (b[i] == 'A')
A[1][i + 1]++;
if (a[i] == 'C')
C[0][i + 1]++;
if (b[i] == 'C')
C[1][i + 1]++;
if (a[i] == 'A' && b[i] == 'C')
AC[i + 1]++;
if (a[i] == 'C' && b[i] == 'A')
AC[i + 1]--;
if (a[i] == b[i])
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
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...