Submission #433411

#TimeUsernameProblemLanguageResultExecution timeMemory
433411KanaifuMartian DNA (IOI16_dna)C++14
0 / 100
13 ms376 KiB
#include <bits/stdc++.h> #include "dna.h" #include <cstdlib> //#include "grader.cpp" using namespace std; mt19937 randseed(time(nullptr)); std::string analyse(int n, int t) { bool suff = false; int last = 0; string sub = ""; string las = ""; while ((int)las.size()<n) { if (suff) { sub = "0" + sub; if (!make_test(sub)) { sub[0] = '1'; } las = sub; continue; } int koristi = randseed() % 2; if (koristi) { sub += "1"; if (make_test(sub)) { las = sub; last = 0; } else { sub.back()= '0'; last++; if (last>20) { suff=true; sub = las; continue; } } } else { sub += "0"; if (make_test(sub)) { las = sub; last = 0; } else { sub.back() = '1'; last++; if (last>20) { suff=true; sub = las; continue; } } } //cout<<las<<" "; } return las; }

Compilation message (stderr)

grader.cpp: In function 'bool make_test(std::string)':
grader.cpp:14:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   14 |  for (int i = 0; i < p.size(); i++) {
      |                  ~~^~~~~~~~~~
grader.cpp:23:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   23 |  for (int i = 1; i <= ss.size(); i++) {
      |                  ~~^~~~~~~~~~~~
grader.cpp:28:13: warning: comparison of integer expressions of different signedness: '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'} and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   28 |   if (pr[i] == p.size()) {
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...