Submission #636329

#TimeUsernameProblemLanguageResultExecution timeMemory
636329hy_1Mutating DNA (IOI21_dna)C++17
0 / 100
34 ms2388 KiB
#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);

vector<string> you;


void init(string a, string b) {
    you.push_back(a);
    you.push_back(b);
}

int get_distance(int x, int y) {
    string h,s;
    h = s = "";
    for(int i =x; i<=y; i++){
        h += you[0][i];
        s += you[1][i];
    }
    for(int i = 0; i <h.size(); i ++){
        if(count(all(h) , h[i]) != count(all(s) , h[i])) return -1;
    }
    int a,t;
    a = t = 0;
    //a => t
    for(int i =0; i <h.size(); i++){
        if(s[i] != h[i] && s[i] == 'A'){
            a++;
        }else if(s[i] != h[i] && s[i] == 't'){
            t++;
        }
    }
    return t;
}

Compilation message (stderr)

dna.cpp: In function 'int get_distance(int, int)':
dna.cpp:57:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   57 |     for(int i = 0; i <h.size(); i ++){
      |                    ~~^~~~~~~~~
dna.cpp:63:21: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   63 |     for(int i =0; i <h.size(); i++){
      |                   ~~^~~~~~~~~
#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...