Submission #1122942

#TimeUsernameProblemLanguageResultExecution timeMemory
1122942blackslexMutating DNA (IOI21_dna)C++20
21 / 100
26 ms2376 KiB
#include "dna.h" #include<bits/stdc++.h> using namespace std; string s, t; void init(std::string a, std::string b) { s = a; t = b; } int get_distance(int x, int y) { string a = s.substr(x, y - x + 1), b = t.substr(x, y - x + 1); sort(a.begin(), a.end()); sort(b.begin(), b.end()); if (a != b) return -1; int cnt = 0; for (int i = x; i <= y; i++) { if (s[i] != t[i]) cnt++; } return (!cnt ? 0 : --cnt); }
#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...