Submission #251404

# Submission time Handle Problem Language Result Execution time Memory
251404 2020-07-21T07:09:35 Z tinjyu Martian DNA (IOI16_dna) C++14
0 / 100
1000 ms 384 KB
#include "dna.h"
#include <iostream>
#include <cstdlib>
using namespace std;

string ans,tmp;
std::string analyse(int n, int t) {
    ans="";
    long long int cnt=0;
    while(ans.length()<n)
    {
    	long long int temp=rand();
    	if(temp==0)tmp=ans+"0";
    	else tmp=ans+"1";

		if(make_test(tmp)==1)
    	{
    		ans=tmp;
    		cnt=0;
    		continue;
		}
		else if(make_test(tmp)==1)
		{
			if(temp==1)ans+="0";
			else ans+="1";
			cnt++;
			if(cnt==12)
			{
				for(int i=1;i<=12;i++)
				{
					string te="";
					for(int j=1;j<=ans.length()-12+i;j++)
					{
						te+=ans[j-1];
					}
					if(make_test(te)==0)
					{
						te="";
						for(int j=1;j<=ans.length()-12+i-1;j++)
						{
							te+=ans[j-1];
						}
						ans=te;
						break;
					}
				}
				break;
			}
			continue;
		}
	}
	while(ans.length()<n)
	{
		tmp="0"+ans;
    	if(make_test(tmp)==1)
    	{
    		ans="0"+ans;
    		continue;
		}
		else 
		{
			ans="1"+ans;
		}
	}
	long long int l=1,r=n;
	string tmpans;
    return ans;
}

Compilation message

dna.cpp: In function 'std::__cxx11::string analyse(int, int)':
dna.cpp:10:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     while(ans.length()<n)
           ~~~~~~~~~~~~^~
dna.cpp:32:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
      for(int j=1;j<=ans.length()-12+i;j++)
                  ~^~~~~~~~~~~~~~~~~~~
dna.cpp:39:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       for(int j=1;j<=ans.length()-12+i-1;j++)
                   ~^~~~~~~~~~~~~~~~~~~~~
dna.cpp:52:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  while(ans.length()<n)
        ~~~~~~~~~~~~^~
dna.cpp:65:16: warning: unused variable 'l' [-Wunused-variable]
  long long int l=1,r=n;
                ^
dna.cpp:65:20: warning: unused variable 'r' [-Wunused-variable]
  long long int l=1,r=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 Execution timed out 1087 ms 256 KB Time limit exceeded
2 Correct 0 ms 256 KB Output is correct
3 Execution timed out 1088 ms 256 KB Time limit exceeded
4 Execution timed out 1076 ms 256 KB Time limit exceeded
5 Execution timed out 1085 ms 256 KB Time limit exceeded
6 Correct 1 ms 256 KB Output is correct
7 Execution timed out 1095 ms 256 KB Time limit exceeded
8 Execution timed out 1097 ms 256 KB Time limit exceeded
9 Execution timed out 1087 ms 256 KB Time limit exceeded
10 Execution timed out 1085 ms 256 KB Time limit exceeded
11 Execution timed out 1081 ms 256 KB Time limit exceeded
12 Execution timed out 1092 ms 256 KB Time limit exceeded
13 Execution timed out 1093 ms 256 KB Time limit exceeded
14 Execution timed out 1092 ms 256 KB Time limit exceeded
15 Correct 1 ms 256 KB Output is correct
16 Execution timed out 1091 ms 256 KB Time limit exceeded
17 Execution timed out 1096 ms 256 KB Time limit exceeded
18 Execution timed out 1091 ms 256 KB Time limit exceeded
19 Execution timed out 1084 ms 256 KB Time limit exceeded
20 Execution timed out 1090 ms 256 KB Time limit exceeded
21 Execution timed out 1083 ms 256 KB Time limit exceeded
22 Execution timed out 1087 ms 256 KB Time limit exceeded
23 Execution timed out 1087 ms 256 KB Time limit exceeded
24 Execution timed out 1081 ms 256 KB Time limit exceeded
# Verdict Execution time Memory Grader output
1 Execution timed out 1096 ms 256 KB Time limit exceeded
2 Correct 0 ms 256 KB Output is correct
3 Execution timed out 1097 ms 256 KB Time limit exceeded
4 Execution timed out 1085 ms 256 KB Time limit exceeded
5 Execution timed out 1081 ms 256 KB Time limit exceeded
6 Correct 1 ms 256 KB Output is correct
7 Execution timed out 1092 ms 256 KB Time limit exceeded
8 Correct 0 ms 256 KB Output is correct
9 Execution timed out 1088 ms 256 KB Time limit exceeded
10 Execution timed out 1093 ms 256 KB Time limit exceeded
11 Execution timed out 1086 ms 256 KB Time limit exceeded
12 Execution timed out 1091 ms 256 KB Time limit exceeded
13 Execution timed out 1075 ms 256 KB Time limit exceeded
14 Execution timed out 1097 ms 256 KB Time limit exceeded
15 Execution timed out 1072 ms 256 KB Time limit exceeded
16 Execution timed out 1087 ms 256 KB Time limit exceeded
17 Execution timed out 1090 ms 256 KB Time limit exceeded
18 Execution timed out 1090 ms 256 KB Time limit exceeded
19 Execution timed out 1088 ms 256 KB Time limit exceeded
20 Execution timed out 1092 ms 256 KB Time limit exceeded
21 Execution timed out 1086 ms 256 KB Time limit exceeded
22 Execution timed out 1097 ms 256 KB Time limit exceeded
23 Execution timed out 1086 ms 256 KB Time limit exceeded
24 Execution timed out 1089 ms 256 KB Time limit exceeded
25 Correct 1 ms 384 KB Output is correct
26 Execution timed out 1093 ms 256 KB Time limit exceeded
27 Execution timed out 1095 ms 256 KB Time limit exceeded
28 Execution timed out 1069 ms 256 KB Time limit exceeded
29 Execution timed out 1085 ms 256 KB Time limit exceeded
30 Execution timed out 1085 ms 256 KB Time limit exceeded
31 Execution timed out 1076 ms 256 KB Time limit exceeded
32 Execution timed out 1074 ms 256 KB Time limit exceeded
33 Execution timed out 1082 ms 256 KB Time limit exceeded
34 Execution timed out 1090 ms 256 KB Time limit exceeded
# Verdict Execution time Memory Grader output
1 Execution timed out 1085 ms 256 KB Time limit exceeded
2 Correct 1 ms 256 KB Output is correct
3 Execution timed out 1087 ms 256 KB Time limit exceeded
4 Execution timed out 1069 ms 256 KB Time limit exceeded
5 Execution timed out 1022 ms 256 KB Time limit exceeded
6 Correct 1 ms 256 KB Output is correct
7 Execution timed out 1085 ms 256 KB Time limit exceeded
8 Correct 1 ms 256 KB Output is correct
9 Execution timed out 1081 ms 256 KB Time limit exceeded
10 Execution timed out 1094 ms 256 KB Time limit exceeded
11 Execution timed out 1080 ms 256 KB Time limit exceeded
12 Execution timed out 1079 ms 256 KB Time limit exceeded
13 Execution timed out 1085 ms 256 KB Time limit exceeded
14 Execution timed out 1094 ms 256 KB Time limit exceeded
15 Execution timed out 1093 ms 256 KB Time limit exceeded
16 Execution timed out 1074 ms 256 KB Time limit exceeded
17 Execution timed out 1085 ms 256 KB Time limit exceeded
18 Execution timed out 1095 ms 256 KB Time limit exceeded
19 Execution timed out 1077 ms 256 KB Time limit exceeded
20 Execution timed out 1086 ms 256 KB Time limit exceeded
21 Execution timed out 1099 ms 256 KB Time limit exceeded
22 Execution timed out 1095 ms 384 KB Time limit exceeded
23 Execution timed out 1052 ms 256 KB Time limit exceeded
24 Execution timed out 1094 ms 256 KB Time limit exceeded
25 Execution timed out 1091 ms 256 KB Time limit exceeded
26 Execution timed out 1084 ms 256 KB Time limit exceeded
27 Execution timed out 1086 ms 256 KB Time limit exceeded
28 Execution timed out 1089 ms 256 KB Time limit exceeded
29 Execution timed out 1092 ms 256 KB Time limit exceeded
30 Correct 7 ms 384 KB Output is correct
31 Execution timed out 1091 ms 384 KB Time limit exceeded
32 Execution timed out 1087 ms 256 KB Time limit exceeded
33 Execution timed out 1085 ms 256 KB Time limit exceeded
34 Execution timed out 1099 ms 256 KB Time limit exceeded
35 Execution timed out 1099 ms 256 KB Time limit exceeded
36 Execution timed out 1099 ms 256 KB Time limit exceeded
37 Execution timed out 1099 ms 256 KB Time limit exceeded
38 Execution timed out 1099 ms 256 KB Time limit exceeded
39 Execution timed out 1094 ms 256 KB Time limit exceeded