Submission #162267

#TimeUsernameProblemLanguageResultExecution timeMemory
162267popovicirobertMartian DNA (IOI16_dna)C++14
36 / 100
16 ms380 KiB
#include "dna.h" #include <bits/stdc++.h> using namespace std; std::string analyse(int n, int t) { if(make_test("0") == 0) { string sol; sol.resize(n); fill(sol.begin(), sol.end(), '1'); return sol; } string sol = "0"; while(sol.size() < n) { sol.push_back(sol.back()); if(make_test(sol)) { continue; } sol.back() = '0' + ((sol.back() - '0') ^ 1); if(make_test(sol)) { continue; } sol.pop_back(); break; } while(sol.size() < n) { sol = sol.substr(0, 1) + sol; if(make_test(sol)) { continue; } sol[0] = '0' + ((sol[0] - '0') ^ 1); } return sol; }

Compilation message (stderr)

dna.cpp: In function 'std::__cxx11::string analyse(int, int)':
dna.cpp:14:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     while(sol.size() < n) {
           ~~~~~~~~~~~^~~
dna.cpp:26:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     while(sol.size() < n) {
           ~~~~~~~~~~~^~~
grader.cpp: In function 'bool make_test(std::__cxx11::string)':
grader.cpp:14:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for (int i = 0; i < p.size(); i++) {
                  ~~^~~~~~~~~~
grader.cpp:23:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for (int i = 1; i <= ss.size(); i++) {
                  ~~^~~~~~~~~~~~
grader.cpp:28:13: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   if (pr[i] == p.size()) {
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...