Submission #59282

#TimeUsernameProblemLanguageResultExecution timeMemory
59282TadijaSebezMartian DNA (IOI16_dna)C++11
36 / 100
19 ms1480 KiB
#include "dna.h" #include <stdio.h> #include <stdlib.h> #include <algorithm> #include <iostream> #include <string> #include <ctime> using namespace std; string sol; int qu; bool Check(string s){ return make_test(s);}//qu++;return sol.find(s)!=string::npos;} string analyse(int n, int t) { string tmp=""; int cnt=0; while(cnt<10) { char s='0'+(rand()&1); //cout << s << "\n"; if(Check(tmp+s)) { tmp+=s; cnt=0; } else { //printf(":D\n"); cnt++; tmp+=('0'+((s-'0')^1)); //cout << tmp << "\n"; } //printf("WORK\n"); } //cout << tmp << "\n"; //exit(0); for(int i=0;i<10;i++) { if(Check(tmp)) break; tmp=tmp.substr(0,tmp.size()-1); } while(tmp.size()<n) { tmp='0'+tmp; if(!Check(tmp)) tmp[0]='1'; } //cout << tmp << "\n"; return tmp; }

Compilation message (stderr)

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