Submission #966768

#TimeUsernameProblemLanguageResultExecution timeMemory
966768SuPythonyMutating DNA (IOI21_dna)C++17
0 / 100
23 ms2832 KiB
#include "dna.h" #include <bits/stdc++.h> using namespace std; vector<int> pf(1e5+1,0); void init(string a, string b) { for (int i=1; i<=a.size(); i++) { if (a[i]!=b[i]) { pf[i]=pf[i-1]+1; } else { pf[i]=pf[i-1]; } } } int get_distance(int x, int y) { int c=pf[y]-pf[x-1]; return c/2+c%2; }

Compilation message (stderr)

dna.cpp: In function 'void init(std::string, std::string)':
dna.cpp:8:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    8 |     for (int i=1; i<=a.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...