Submission #127326

#TimeUsernameProblemLanguageResultExecution timeMemory
127326zoooma13Martian DNA (IOI16_dna)C++14
100 / 100
41 ms380 KiB
#include "bits/stdc++.h" #include "dna.h" using namespace std; mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); #define rnd(s ,e) uniform_int_distribution<int>(s, e)(rng) string analyse(int n, int t) { string s = ""; int wrong = 0; while(wrong < 16){ char x = ('0'+rnd(0 ,1)); if(make_test(s+x)) s = s + x ,wrong = 0; else s = s + (char)(x^1) ,wrong++; } int st = 0 ,en = 16 ,mid; while(st <= en){ mid = (st+en)>>1; if(make_test(s.substr(0 ,s.size()-mid))) en = mid-1; else st = mid+1; } s = s.substr(0 ,s.size()-st); while(s.size() < n){ if(make_test('0'+s)) s = '0'+s; else s = '1'+s; } return s; }

Compilation message (stderr)

dna.cpp: In function 'std::__cxx11::string analyse(int, int)':
dna.cpp:29:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     while(s.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...