Submission #934355

#TimeUsernameProblemLanguageResultExecution timeMemory
934355AtabayRajabliMutating DNA (IOI21_dna)C++17
0 / 100
23 ms2832 KiB
#include "dna.h" #include <bits/stdc++.h> const int sz = 1e5 + 5; int p[sz]; void init(std::string a, std::string b) { for(int i = 0; i < a.size(); i++) { p[i + 1] = p[i] + int(a[i] != b[i]); } } int get_distance(int x, int y) { x++, y++; int v = p[y] - p[x - 1]; if(v % 2)return -1; return v / 2; }

Compilation message (stderr)

dna.cpp: In function 'void init(std::string, std::string)':
dna.cpp:8:19: 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 = 0; 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...