Submission #440004

#TimeUsernameProblemLanguageResultExecution timeMemory
440004ala2Mutating DNA (IOI21_dna)C++17
0 / 100
36 ms2856 KiB
#include "dna.h" #include <iostream> using namespace std; string s="",c=""; int a2[1001000]; int b2[1001000]; void init(string a, string b) { s=a; c=b; int n=s.size(); int g=0; for(int i=0;i<n;i++) { if(s[i]!=c[i]) g++; a2[i]=g; } } int get_distance(int x, int y) { int m=a2[y]-a2[x]+(s[x]!=c[x]); if(m%2) return -1; else return m/2; return 0; }
#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...