Submission #71446

# Submission time Handle Problem Language Result Execution time Memory
71446 2018-08-24T16:52:30 Z memikakizaki Hidden Sequence (info1cup18_hidden) C++14
10 / 100
400 ms 556 KB
#include<bits/stdc++.h>
#include "grader.h"

using namespace std;

vector<int> findSequence(int n) {
	vector<int> curr;
	while(curr.size() < n) {
		for(int i = 0; i < curr.size()+1; i++) {
			curr.insert(curr.begin() + i, 0);
			if(!isSubsequence(curr)) {
				curr.erase(curr.begin() + i);
				curr.insert(curr.begin() + i, 1);
				if(!isSubsequence(curr)) {
					curr.erase(curr.begin() + i);
				} else break;
			} else break;
		}
	}
	return curr;
}

Compilation message

hidden.cpp: In function 'std::vector<int> findSequence(int)':
hidden.cpp:8:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  while(curr.size() < n) {
        ~~~~~~~~~~~~^~~
hidden.cpp:9:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(int i = 0; i < curr.size()+1; i++) {
                  ~~^~~~~~~~~~~~~~~
grader.cpp: In function 'int main()':
grader.cpp:28:43: warning: format '%d' expects argument of type 'int', but argument 3 has type 'std::vector<int>::size_type {aka long unsigned int}' [-Wformat=]
     fprintf (fifo_out, "%d\n", ans.size ());
                                ~~~~~~~~~~~^
grader.cpp:29:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (int i=0; i<ans.size () && i < N; i++)
                   ~^~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Partially correct 2 ms 292 KB Output is partially correct: Maximum length of a query = 8
2 Partially correct 2 ms 456 KB Output is partially correct: Maximum length of a query = 10
3 Partially correct 3 ms 456 KB Output is partially correct: Maximum length of a query = 8
4 Partially correct 3 ms 456 KB Output is partially correct: Maximum length of a query = 9
5 Partially correct 2 ms 456 KB Output is partially correct: Maximum length of a query = 7
# Verdict Execution time Memory Grader output
1 Partially correct 389 ms 480 KB Output is partially correct: Maximum length of a query = 165
2 Execution timed out 416 ms 556 KB Time limit exceeded
3 Halted 0 ms 0 KB -