# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
636340 | hy_1 | Mutating DNA (IOI21_dna) | C++17 | 1581 ms | 3884 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "dna.h"
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <cmath>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdio.h>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <unordered_map>
using namespace std;
#define MOD 1000000007
#define all(x) x.begin(),x.end()
#define ios ios_base::sync_with_stdio(0);cin.tie(0);
string s1 , s2;
void init(string a, string b) {
s1 = a;
s2 = b;
}
int get_distance(int x, int y) {
string a,b;
a= b = "";
for(int i =x; i<=y; i++){
a += s1[i];
b += s2[i];
}
string e = a;
string h = b;
sort(all(e));
sort(all(h));
if(e != h){
return -1;
}
if(a == b){
return 0;
}
int ans = 0;
for(int i =0; i< a.size(); i ++){
if(a[i] != b[i]){
ans++;
}
}
return ans/2;
}
// int main(){
// string a,b; cin >> a >> b;
// init(a,b);
// int l,r; cin >> l >> r;
// cout << get_distance(l,r) << endl;
// return 0;
// }
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |