Submission #1059477

#TimeUsernameProblemLanguageResultExecution timeMemory
1059477LittleOrangeMutating DNA (IOI21_dna)C++17
21 / 100
24 ms3932 KiB
#include "dna.h" #include<bits/stdc++.h> using namespace std; using ll = int; ll n; string a,b; void init(std::string A, std::string B) { a = A; b = B; } int get_distance(int x, int y) { string sa = a.substr(x,y-x+1); string sb = b.substr(x,y-x+1); if(sa==sb) return 0; string u = sa,v = sb; sort(u.begin(),u.end()); sort(v.begin(),v.end()); if (u!=v) return -1; if(sa.size()==2) return 1; if(sa.size()==3){ if (sa[0]==sb[0]||sa[1]==sb[1]||sa[2]==sb[2]) return 1; return 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...