Submission #33858

#TimeUsernameProblemLanguageResultExecution timeMemory
33858wan2000Martian DNA (IOI16_dna)C++14
36 / 100
26 ms2016 KiB
#include "dna.h" #include <bits/stdc++.h> using namespace std; string analyse(int n, int t){ string res = ""; int l = 1, r = n, mid; while(l<=r){ mid = (l+r)>>1; string tmp = res; while(tmp.size()<mid){ if(make_test(tmp+"0")) tmp += "0"; else tmp += "1"; } if(make_test(tmp)){ res = tmp; l = mid+1; } else{ r = mid-1; } } while(res.size()<n){ if(make_test("0"+res)) res = "0" + res; else res = "1" + res; } return res; }

Compilation message (stderr)

dna.cpp: In function 'std::__cxx11::string analyse(int, int)':
dna.cpp:12:25: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         while(tmp.size()<mid){
                         ^
dna.cpp:24:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     while(res.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...