Submission #59282

# Submission time Handle Problem Language Result Execution time Memory
59282 2018-07-21T11:45:56 Z TadijaSebez Martian DNA (IOI16_dna) C++11
36 / 100
19 ms 1480 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, 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

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 time Memory Grader output
1 Correct 4 ms 504 KB Output is correct
2 Correct 3 ms 604 KB Output is correct
3 Correct 3 ms 680 KB Output is correct
4 Correct 3 ms 680 KB Output is correct
5 Correct 3 ms 680 KB Output is correct
6 Correct 3 ms 680 KB Output is correct
7 Correct 3 ms 792 KB Output is correct
8 Correct 3 ms 792 KB Output is correct
9 Correct 3 ms 792 KB Output is correct
10 Correct 3 ms 792 KB Output is correct
11 Correct 3 ms 792 KB Output is correct
12 Correct 3 ms 792 KB Output is correct
13 Correct 3 ms 792 KB Output is correct
14 Correct 3 ms 884 KB Output is correct
15 Correct 3 ms 884 KB Output is correct
16 Correct 3 ms 884 KB Output is correct
17 Correct 2 ms 884 KB Output is correct
18 Correct 2 ms 884 KB Output is correct
19 Correct 2 ms 884 KB Output is correct
20 Correct 3 ms 884 KB Output is correct
21 Correct 3 ms 928 KB Output is correct
22 Correct 3 ms 928 KB Output is correct
23 Correct 2 ms 928 KB Output is correct
24 Correct 2 ms 928 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 4 ms 944 KB Output is correct
2 Correct 2 ms 944 KB Output is correct
3 Correct 4 ms 944 KB Output is correct
4 Correct 3 ms 948 KB Output is correct
5 Correct 2 ms 952 KB Output is correct
6 Correct 4 ms 960 KB Output is correct
7 Correct 2 ms 960 KB Output is correct
8 Correct 2 ms 964 KB Output is correct
9 Correct 4 ms 968 KB Output is correct
10 Correct 4 ms 980 KB Output is correct
11 Correct 3 ms 980 KB Output is correct
12 Correct 3 ms 984 KB Output is correct
13 Correct 4 ms 988 KB Output is correct
14 Correct 2 ms 988 KB Output is correct
15 Correct 2 ms 992 KB Output is correct
16 Correct 2 ms 996 KB Output is correct
17 Correct 4 ms 1004 KB Output is correct
18 Correct 3 ms 1004 KB Output is correct
19 Correct 3 ms 1008 KB Output is correct
20 Correct 3 ms 1012 KB Output is correct
21 Correct 4 ms 1016 KB Output is correct
22 Correct 4 ms 1020 KB Output is correct
23 Correct 3 ms 1024 KB Output is correct
24 Correct 3 ms 1156 KB Output is correct
25 Correct 3 ms 1156 KB Output is correct
26 Correct 3 ms 1156 KB Output is correct
27 Correct 3 ms 1156 KB Output is correct
28 Correct 4 ms 1156 KB Output is correct
29 Correct 4 ms 1156 KB Output is correct
30 Correct 3 ms 1156 KB Output is correct
31 Correct 3 ms 1188 KB Output is correct
32 Correct 3 ms 1188 KB Output is correct
33 Correct 3 ms 1188 KB Output is correct
34 Correct 3 ms 1188 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 1188 KB Output is correct
2 Correct 3 ms 1188 KB Output is correct
3 Correct 3 ms 1196 KB Output is correct
4 Correct 3 ms 1196 KB Output is correct
5 Correct 3 ms 1196 KB Output is correct
6 Correct 3 ms 1196 KB Output is correct
7 Correct 3 ms 1232 KB Output is correct
8 Correct 3 ms 1232 KB Output is correct
9 Correct 3 ms 1232 KB Output is correct
10 Correct 3 ms 1232 KB Output is correct
11 Correct 3 ms 1232 KB Output is correct
12 Correct 3 ms 1232 KB Output is correct
13 Correct 2 ms 1232 KB Output is correct
14 Correct 3 ms 1232 KB Output is correct
15 Correct 3 ms 1232 KB Output is correct
16 Correct 3 ms 1232 KB Output is correct
17 Correct 3 ms 1232 KB Output is correct
18 Correct 3 ms 1232 KB Output is correct
19 Correct 3 ms 1232 KB Output is correct
20 Correct 4 ms 1232 KB Output is correct
21 Correct 3 ms 1232 KB Output is correct
22 Correct 19 ms 1232 KB Output is correct
23 Correct 19 ms 1296 KB Output is correct
24 Correct 16 ms 1296 KB Output is correct
25 Correct 13 ms 1296 KB Output is correct
26 Correct 19 ms 1428 KB Output is correct
27 Incorrect 11 ms 1428 KB Wrong DNA
28 Correct 11 ms 1428 KB Output is correct
29 Correct 13 ms 1428 KB Output is correct
30 Correct 14 ms 1428 KB Output is correct
31 Incorrect 12 ms 1428 KB Wrong DNA
32 Incorrect 18 ms 1428 KB Wrong DNA
33 Incorrect 12 ms 1428 KB Wrong DNA
34 Correct 14 ms 1428 KB Output is correct
35 Incorrect 13 ms 1428 KB Wrong DNA
36 Incorrect 12 ms 1428 KB Wrong DNA
37 Incorrect 11 ms 1428 KB Wrong DNA
38 Correct 15 ms 1480 KB Output is correct
39 Incorrect 16 ms 1480 KB Wrong DNA