Submission #59281

# Submission time Handle Problem Language Result Execution time Memory
59281 2018-07-21T11:45:01 Z TadijaSebez Martian DNA (IOI16_dna) C++11
Compilation error
0 ms 0 KB
#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)
{
    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

dna.cpp: In function 'std::__cxx11::string analyse(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()) {
/tmp/ccDu3Wn3.o: In function `main':
grader.cpp:(.text.startup+0x41): undefined reference to `analyse[abi:cxx11](int, int)'
collect2: error: ld returned 1 exit status